In the engine roomis quite lonely, cannot see a person.
机房里相当冷清,看不到一个人。After allthislittle whileis taking summer vacation, exams for postgraduate schoolsarmiesgenerallyalsoelectricitybrain.
毕竟这会儿在放暑假,考研大军们一般也用不上电脑。Walkedto turn on the air conditioning, Lu Zhoulooks . the loomto sit downcasually, inputsownstudent number and password, proficientlyregisteredcomputer
走过去打开空调,陆舟随便找了台机子坐下,输入自己的学号和密码,熟练地登录电脑。Reason that the engine room of choiceschool, is mainly because the procedure/program of pythonlanguagecompilationmainlyoperatesunder the Linuxsystem, studies the pythonlanguageit can be said thatto kill two birds with one stonein the Linuxenvironmentdirectly.
之所以选择学校的机房,主要是因为python语言编写的程序主要都是在Linux系统下运行,直接在Linux环境下学习python语言可以说是一举两得。ButLu Zhouownsecond-handnotebook too trash, the papertransferred the pdfform to playing deada while, playedto rubto rubothersto startto the lineheto stand the spring water, installed the double systemorvirtual machinetheseshowsoperatesdoes not needto think.
而陆舟自己的二手笔记本实在太垃圾了,论文转个pdf格式都得假死一会儿,玩个撸啊撸别人都开始对线了他才站上泉水,装双系统或者虚拟机这些骚操作是不用想的。„Althoughin the booksaidvery muchclearly, has not thought that thisgadgetusedsuchtroublesome...... really the thing and actual operation on paper is completely two matters, wantsto learn the thingby the practice.”
“虽然书上都讲得很清楚了,没想到这玩意儿用起来这么麻烦……果然纸上的东西和实际操作起来完全是两回事,想学到东西还是得靠实践啊。”FirsttimeLu Zhou that uses the Linuxsystemonlyfelt that twograspblindly, according to the explanationcourse that borrowsfrom the librarylookedsome little time, found out the way.
第一次使用Linux系统的陆舟只感觉两眼抓瞎,照着从图书馆借来的说明教程看了好一会儿,才算是摸清楚了门道。Has saying that otherswindowssystemgrabssuchbigmarket sharereasonable, even if the operating system of entirepatternhas not bumpedcomputerlittlewhitecompletely, can still very relaxedseat of honor.
不得不说,别人windows系统占据这么大的市场份额还是有道理的,全图型的操作系统即便是完全没碰过电脑的小白,也能很轻松的上手。However the Linuxsystemis different, basicallyis the command lineoperator schema, cancompletealloperationsthrough the keyboard. Whatalsoluckilyschoolattirehas the releaseversion of desktopenvironment, orLu Zhouhas really not known that mousegadgetis useful.
然而Linux系统却不一样,基本上是命令行操作模式,通过键盘就能完成一切操作。也幸亏学校装的是带有桌面环境的发行版,要不陆舟还真不知道鼠标这玩意儿有啥用。Naturally, the Linuxmerit is also very significant, strongmay the custom-madenature and securitycausesitcompared withwindowssystemmore suitableserverand otherdomains. Oncewere familiar with the command lineoperation, the efficiencywill continuecompared withwindowssystemhighseveral times. Thereforemanyenterpriseswhenadvertise foraround the server the endprogrammerto askone, canuse the Linuxsystem.
当然了,Linux的优点也很明显,超强的可定制性和安全性使得它比windows系统更适合服务器等领域。而且一旦熟悉了命令行操作,效率将比windows系统高个数倍不止。所以很多企业在招聘服务器前后端程序员的时候都会问一句,会不会用Linux系统。Was familiar with the elementary operation eo of Linuxsystem, Lu Zhouturned on the pythonsoftware, opened the books, satis in a dazein front of the computer.
熟悉了Linux系统的基本操作,陆舟打开了python软件,翻开了书本,坐在电脑面前发呆。„Speaking of one of the pythonutilizationisto compile the web crawler, wantsto examine the study resultwords, fromthisstartisbestwhatreptile...... makes?”
“说到python的运用之一就是编写网络爬虫,想要检验学习成果的话,从这个开始是最好的……可是做个什么爬虫呢?”Lu Zhouis lost in thought.陆舟不禁陷入了沉思。Crawls the blog on Weibo?
爬围脖上的博文?Crawlingpostpost?
爬贴吧的帖子?Probablyis very bored.
好像挺无聊的。
The keyisto crawldata in handuseless, are many place that putcontinuallynot to have.
关键是爬下来的数据拿在手上没用,多了连放的地方都没有。Suddenly, inhisheartmoves, does not knowwhat kind ofrecalledeach time the ticket bookingexperience of going homepain. Actuallybecause ofhiscomputer card, because the uidesign of Railways Ministryofficial site was really the anti-human.
忽然,他心中一动,不知怎么的就回忆起了每次回家痛苦的抢票经历。倒不是因为他电脑卡,而是因为铁道部官网的ui设计实在是太反人类了。„Crawlsto take various stations, coach numbers and numbers of votes12306websites...... thisprobablywith the reptiletechnologyto doaccording to the information.”
“用爬虫技术爬取12306网站的各车站、车次、余票数据信息……这个好像可以搞啊。”Thinks ofhere, Lu Zhoualsono longerrubbed gently, immediatelystartsto work.
一想到这里,陆舟也不再磨蹭了,立刻开始干活。After allas the onetypicalutilizationmodel of pythonlanguage, the template of reptileprocedure/programhasto mention that in the book, moreoverin view of the differentsituations, in the bookalsoaimed at the algorithmto conduct the improvementsin varying degrees.
毕竟作为python语言的一种典型运用范例,爬虫程序的模板在书中都是有提到的,而且针对不同种情况,书中还针对算法进行了不同程度的改良。Naturally, 12306after allare not the commonBBSforums, thisas the practicegoal of beginner, there is a bigdifficulty.
当然了,12306毕竟不是一般BBS论坛,把这个作为初学者的练习目标,还是有不小难度的。Howevermerelyis also big, regardinghas had a thorough understandinglandXueba who puts in orderthisbook, the issue is actually not big. The reptiletoohightechnical difficulty, less than30lines of codeshad not handled the entireprocedure/program, the perfectoperationdoes not havebug.
不过也仅仅是不小而已,对于已经吃透了整本书的陆学霸来说,问题却是不大。爬虫本身并没有太高的技术难度,不到30行代码就搞定了整个程序,完美运行无bug。Thencaptured.
然后紧接着就是抓取了。
The urlduplicationwebsitebehind the code, the Lu Zhouchoiceoperates, and data generationform, inductstoconstructsin the goodfolderin advance.
将网站的url复制在代码后面,陆舟选择运行,并且将数据生成表格,导入到预先建好的文件夹中。
The ventilator of engine casestartswēng wēngto make noise, Kartun who the computerchangesgets up, an all various professionscodeflashes throughfrom the blackdialog box, was reorganizedin the formrapidly.
紧接着机箱的风扇开始嗡嗡作响,电脑变的卡顿起来,一行行编码从黑色的对话框中闪过,被迅速整理进表格中。Looks at the unceasinglyfilledfolder, bysighs with emotionin the Lu Zhouheart on chair.
看着不断被填充的文件夹,靠在椅子上的陆舟心中感慨。„Pythonlanguagemotheris really convenient, no wonderso manybigcowsrecommendthisgadget.”
“python语言真尼玛方便,难怪那么多大牛推荐这玩意儿。”Looks the information that an all various professionsdataflashes through, Lu Zhouhas also really planted the hackeraddictionmisconception.
看着一行行数据闪过的信息,陆舟还真有种过把黑客瘾的错觉。Howevernaturally, merelyis the misconception, evenfeelsis far from, after allthisgadget and hackertechnologycompleteeightbamboo polescannot hitside. Crawlsto take the publicinformationfrom the servernot to violate the law, has the suspicion that at mostoccupiesothersserver resource, will be hatedby the majorstationmasters.
不过当然了,也仅仅是错觉而已,连感觉都谈不上,毕竟这玩意儿和黑客技术完全八竿子打不着边。从服务器上爬取公开信息是不犯法的,顶多有挤占别人服务器资源的嫌疑,会被各大站长痛恨不已。Therefore„mean-spirited” the websitewill establish the counter-reptileprocedure/program, the technicalhigh spoteithermakesyouranythingthingnot crawl, eithercrawlsis the additive device, the technique contentlow can also through the accessmonitoring, lockyouripdirectly.
所以很多“小气”的网站会设置有反爬虫程序,技术高点的要么让你什么东西都爬不到,要么爬下来的都是乱码,技术含量低的也可以通过访问次数监控,直接锁了你的ip。
The however12306websitesare not obviously mean-spirited, think the monopolygiant who user experiencedoes not a, will care aboutthatserver resource? So long asdo not toss aboutfather'sserverthrow the street, whomanagesyou!
不过12306网站显然没那么小气,想想一个连用户体验都不在意的垄断巨头,会在意那点服务器资源?只要你们别把老子的服务器折腾扑街了,谁管你!Looks the coach numberdata that in the folderpiles upunceasingly, the Lu Zhoueyetransferred the revolutions, was deliberately consideringwhatcandowithit?
看着文件夹里不断堆积的车次数据,陆舟眼睛转了转,寻思着要不要用它来干点啥?„Makesto subscribe the ticketwebsite? Probablysomewhatdoes the unnecessary......”
“做个订车票网站?好像有些脱了裤子放屁……”Suddenly, in the Lu Zhouheartmoves.
忽然,陆舟心中一动。Or......
要不……Makes an onlineorder formapp?
做个网上订票的app?
The idea that thisconceives a plantemporarilybraves, cannotcontroltakes rootto germinateinhisheart.
这个临时起意的想法一冒出来,便不可控制地在他心中生根发芽。Althoughin the networkhasmanythird partiesto order ticketapp, butofficialorder formappreallydid not have. Ifhecanmakeoneunusual, sold tooperator that theseare interested, perhaps can also gain the living expenses.
虽然网络上有不少第三方订票app,但官方的订票app还真没有。如果他能做出来一个与众不同的,卖给那些感兴趣的运营商,说不定还能赚点生活费。Involvesmoney the issue, Lu Zhouwas immediately careful, in the heartstartedto calculateunceasingly.
一涉及到钱的问题,陆舟顿时就上心了,心中开始不断盘算了起来。In the technology, the independencecompletesappfrom a development of fronttorear end, the difficultyis very high, does not write a simplereptileprocedure/program to place on a par, but is actually not ableto complete. The algorithm of let alone, not being able to solve can also ask the system, consuming the General pointsinquirymaterial was also a process of study.
技术上,独立完成一个app从前端到后端的开发,难度很高,远非写一个简单的爬虫程序能相提并论,不过却并非无法完成。更何况,解决不了的算法还能问系统嘛,消耗积分查询资料本身也是一个学习的过程。Whenhecompleted the rewardtask, the unlockingartificial intelligenceLV0thisbranchscience and technology, thesevaluableexperiences can definitely apply.
等他完成了奖励任务,解锁了人工智能LV0这一分支科技,这些宝贵的经验肯定能派上用场。
Perhaps purchasesandmaintains a server to spenda lot ofmoney, the electrical billsandvariousmaintenance costs of operationserver, perhaps are also a bigexpenditure......
只不过购买并维持一台服务器恐怕得花不少钱,运营服务器的电费和各种维护费用,恐怕也是一笔不小的开支……Buthiscard is less than10,000, perhapsburns a smallflameto be difficult.
而他的卡里只有不到一万块,恐怕烧出个小火苗都困难。Clenches teeth, Lu Zhoudecidesto overcomethesedifficult problems.
咬了咬牙,陆舟还是决定克服这些难题。Gave upincluding500,000yearly salaries, what but alsothere is not able to achieve?
连50万的年薪都放弃了,还有什么做不到的?Even ifthrew the street, using temporarily aswasmakes the classto supposepractices acquiring a skillstillmight as well.
就算扑街了,权当是做课设练手也无妨。Therefore, Lu Zhouclosed the procedure/program, sharplyhas not been startingto change the code, butopens the worddocuments, likecompiling the program of paper, startsto design the appdevelopment flowprogram.
于是,陆舟关闭了程序,并没有急着开始改代码,而是打开word的文档,就像编写论文的大纲一样,开始设计app的开发流程大纲。„Train ticketinquirymustcrawlto take the real-time data, the performance requirementtoserveris very high, the codemustbe as far as possible succinct!”
“火车票查询必须爬取实时数据,对服务器的性能要求很高,代码必须尽可能简洁!”„Contact surfacecanbe simple, but the informationis more certainmuchandcomprehensive, this pointcanrefer to the mainstreamthird partyto order ticketapp, butcannot certainlybe completely similar, musthave the creative design......”
“界面可以简单,但信息一定得准确、全面,这一点可以参考主流第三方订票app,不过一定不能完全相似,必须有创新点……”Writes abouthere, the index finger of Lu Zhouis rubbing the keyboardgently, ponderedis very long , to continue to startto type on the keyboard.
写到这里,陆舟的食指轻轻摩擦着键盘,思考了很久,才继续开始敲打键盘。„FirstisAutomatic Ticket booking. Thisshouldnot be the innovation, long ago the cheetahsand360severalbrowsershavethisfunction.”
“首先是自动抢票。这个应该算不上创新,好久以前猎豹、360几个浏览器已经有了这个功能。”„On -hookbrushes the ticket...... not to seeautomaticallyprobably.”Is thinkinglast yearwinter vacationtime, the order formsubscribedlate, severaldraft animals in bedroomsatin front of the computerpressedquicka halfhour of f5, brushed several ticket, Lu Zhoufeltsincerely, the broad masses ofdifficultpeoplecelebrated the new yearto go homewas not easy.
“不过挂机自动刷票……好像还没见过。”想着去年寒假的时候,订票订晚了,寝室里的几个牲口坐在电脑前按了快半个小时的f5,才刷出了几张回去的票,陆舟就深切地感受到,广大劳苦群众过年回家的不容易。Throughrenovates the official sitedataunceasingly, will havecertainmetaphysicsprobabilityto brushsometickets, includingwill bereturns of otherusers, someLu Zhoudid not determine how to come out, butthisfunctioncanconsideractually.
通过不断刷新官网数据,有一定玄学概率会刷出一些票,其中有的是其他用户的退票,有的陆舟也不确定是怎么出来的,不过这个功能倒是可以考虑一下。For exampleestablishestimesandseveralcoach numbers, does for somebodyto help the userrenovate the databy the serverautomatically, submits the orderin the flash that odd/surplusPiaopresents. Inseveralmodels of ticket bookingsoftware that at presenthesees, probablydid not havethisfunction.
比如设定一个时间段和几个车次,由服务器代劳帮用户自动刷新数据,在余票出现的一瞬间提交订单。就目前他看到的几款抢票软件中,好像还没这个功能。Moreoverin the algorithm, realizingprobablyis notverydifficult.
而且在算法上,实现起来好像也不是很难。Thinks ofhere, Lu Zhoulooked upunder the wall clock.
想到这里,陆舟抬头看了下挂钟。
The presentis1 : 00 pm!
现在是下午1点!Preserved the worddocuments, Lu Zhouto rubhad the sleevecompetitive, both handsplacedon the keyboard.
保存了word文档,陆舟干劲十足地撸起袖子,双手放在了键盘上。„Startsto work!”
“开始干活!”
To display comments and comment, click at the button
Comments for Chapter #47: Development APP practices acquiring a skill
Loading
No comments at the moment!
Login to post comment
Settings
Chat
Page refresh is required for change to chat to occur