Chapter 47 - Developing An App Expert

n

n

nTranslator: Henyee Translations Editor: Henyee Translations

nThe computer room was deserted with not a single person in sight.

nAfter all, this was during the summer vacation. The students studying for the graduate entrance exam would not normally use computers.

nLu Zhou went to adjust the air conditioner and sat down. He entered his own student ID and password and skillfully logged onto the computer.

nThe reason why he chose the school’s computer room was mainly due to the fact that programs written in Python had to be run on a Linux computer. Thus, learning Python with a Linux operating system was necessary.

nAlso, Lu Zhou’s second-hand laptop was too crappy. It took forever just to convert a thesis into a PDF file. When he played League of Legends, everyone would be connected but he would be stuck at the fountain. Running a dual operating system or a virtual machine was impossible.

n“The textbook explained this clearly. I didn’t expect it to be so difficult to actually do… Sure enough, to write on paper and to actually code are two completely different things. I guess I would have to learn this by practice.”

nIt was the first time that Lu Zhou had used a Linux computer. He looked at the instructions that he borrowed from the library and finally figured it out.

nSpeaking of which, it made sense that Windows took over such a huge OS market share. Even a noob that had never touched a computer before could use the Windows’ interface.

nHowever, the Linux system was different. It was mainly based on command-line operations. Everything had to be done through the keyboard. Fortunately, the school installed a distribution with a desktop environment. Thus, Lu Zhou could still use the mouse.

nOf course, there were obvious advantages of the Linux operating system. It had superior customizability and security, making it more suitable for servers. Also, once one was familiar with the command line operations, one’s efficiency would be several times higher than using Windows. Therefore, many companies would ask programmers if they could use Linux OS before recruiting them.

nLu Zhou was finally familiar with Linux’s basic operations. He opened up a Python software, opened up the textbook, and sat in front of the computer.

n“I heard one of the best uses of Python is to write a web crawler. If I want to take my knowledge to the test, this should be a good place to start. But what kind of crawler should I code?”

nLu Zhou fell into deep thought.

nCrawl blogs on Weibo?

nCrawl posts on Tieba?

nSeems pretty boring.

nThe key is that the data crawled is useless and I can’t even store them if it was too large.

nSuddenly, his heart ached. He recalled the painful experience of buying a train ticket to go home. It was not because his computer was slow, but because the user interface of the railway website was horrible.

n“Use crawler technology to crawl the stations, trains, and ticket information from the website 12306… Seems to be feasible.”

nLu Zhou thought that since he was here, he did not want to waste any more time and immediately began to work.

nAfter all, the crawler program was mentioned in the textbook as it was a typical example of the application of Python. The book even provided different calculation methods for different situations.

nOf course, 12306 was not an average forum website. Targeting this website as a beginner was quite difficult.

nHowever, for a genius like Lu Zhou, who studied the entire textbook, it was not a big problem. Technically, the crawler itself was not too difficult. The entire program was less than 30 lines. It compiled perfectly with no bugs.

nIt was time for grabbing.

nLu Zhou copied the URL of the website into the code and ran the script. He downloaded the data into a spreadsheet file he created.

nImmediately after, the computer fan began to hum. The computer was running with the lines of code flashing in the black terminal box. The data was automatically entered into the spreadsheet.

nLu Zhou looked at the spreadsheet being filled and leaned against the chair.

n“Python is so convenient. No wonder so many experts recommend this language.”

nLu Zhou looked at the lines of data flashing and felt like a hacker.

nHowever, that was just an illusion. This was completely different than actual hacking. It was not illegal to crawl public information from a server. At most, the server administrator would be pissed off that he was using the server’s bandwidth.

nTherefore, many “selfish” websites had set up anti-crawling measure. One could not crawl any information from them. Even if one did, the information crawled would be garbage. Other less advanced websites could monitor the number of visits and block the IP address.

nHowever, the 12306 website was unselfish. The giant monopoly did not even care about the user experience. Obviously, it would not care about the server’s resources. As long as one did not take down their server, no one cared!

nLu Zhou looked at the lines of data piling up in the spreadsheet. He started to wonder if he should do something else?

n“Make a ticket-buying website? Seems kind of redundant…”

nSuddenly, a light bulb went off in Lu Zhou’s head.

nWhat if…

nI make a ticket-buying app?

nHe thought of his idea and could not control his excitement.

nAlthough there were many third-party ticket booking websites, there were not that many apps. If he could make an outstanding app, he could even make some money off it.

nLu Zhou thought about money and he was suddenly interested. His mind started to calculate.

nTechnically, it was very difficult to independently build an app, full stack. It was far more difficult than writing a simple crawler program, but it was not impossible. He could use the system to solve difficult problems. After all, spending general points to buy knowledge was a part of learning.

nOnce he completed the mission and unlocked the artificial intelligence technology branch, it would definitely come in handy.

nIt was just that the servers could be expensive. Even the electricity bills and the various maintenance costs could be pretty expensive…

nHe had less than ten thousand yuan in his bank account and so, he could not do anything…

nLu Zhou bit his teeth and decided to overcome these problems.

nIf I can reject a half a million yuan salary, I can do anything!

nEven if he failed, he could use it as a learning lesson.

nTherefore, Lu Zhou terminated the program. He did not rush to change the code. He opened up a Word document and just like a thesis, he started to write an application development outline.

n“I have to crawl real-time data of the train ticket. The server requirements are very high and so, the code has to be as efficient as possible!”

n“The interface can be simple. But the information has to be accurate and comprehensive. I should look at third-party ticket booking apps as a reference, but I can’t be completely similar… I have to come up with an original idea…”

nLu Zhou wrote until this part and his finger rubbed the keyboard gently. He thought for a long time and began to tap on the keyboard again.

n“First of all, to automatically buy the tickets is not new. A lot of other browsers have this feature.”

n“But to automatically buy the tickets offline… I haven’t seen that yet.”

nLu Zhou thought back to last winter vacation. He had to refresh the website in his dorm for nearly half an hour before he managed to book a couple of tickets. He felt that it was difficult for people to go home for the New Year.

nTo constantly refreshed the official website would give one a low probability of getting a ticket as there might be some which might be tickets that were refunded from others. Lu Zhou did not know where the tickets could come from, but the function could be considered.

nFor example, setting a time period and several train times. The server would automatically refresh the data and submit the request the moment the ticket appears. He had used several ticket snatching software, and so far, this feature did not seem to be available.

nFurthermore, the concept did not seem that hard to implement.

nLu Zhou thought until this point before he looked at the clock.

nIt’s three o’clock in the afternoon!

nLu Zhou saved the Word document. He then pulled up his sleeves and placed his hands on the keyboard.

n“Work, work!”

n