Skip to content

fighting for one ticket to home during Spring Festival

Notifications You must be signed in to change notification settings

nicephil/homing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOMING...
Description:
The Spring Festival is coming, we have to fight for one train ticket.
programmer is crying: let me come back home.... 
this script is used to grab ticket from 12306.cn

Dependency:
1) curl for posting form to server
2) feh for checking random code
3) sed/awk for processing text
4) bash for running this script
5) ocrad for optical character recognition
6) elinks for checking result from server
7) http://tool.chinaz.com/Tools/URLEncode.aspx for UTF-8 Encoding


Usage:
1) change neccessory information to yours
2) run it first to get offical station_name_list, then update $from_station_telecode, and $to_station_telecode
3) run it, and wait for checking random code twice


Known Issuses:
1) ocrad always gets wrong random code from pictures, user has to take care them.
2) user has to be add station telecode by manually.
3) user has to be modified the last form, if he wants to buy more than two tickets once
4) doesn't support net pay yet.


blog: http://blog.chinaunix.net/space.php?uid=10851858&do=blog&id=3058936

About

fighting for one ticket to home during Spring Festival

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages