The computer room was deserted. There was not a single person in sight.
After all, it was summer break and most of the students did not have access to a computer.
Lu Zhou walked over and turned on the air conditioner. He found a computer and sat down, entered his student number and password, and skillfully logged into the computer.
The reason why he chose the school's computer room was mainly because Python programs mainly ran on the Linux system. Learning Python in the Linux environment could be considered killing two birds with one stone.
On the other hand, Lu Zhou's second-hand laptop was too trashy. He had to pretend to be dead for a while to convert his thesis to PDF format. He would only get online when he was playing League of Legends. There was no way he could install a dual system or a virtual machine.
"Although the book explained it clearly, I didn't expect it to be so troublesome … Sure enough, what's written on paper and actually using it are two different things. If I want to learn something, I have to rely on practice."
Lu Zhou, who was using the Linux system for the first time, felt like he was at a loss. He followed the instructions from the library for a while before he finally figured it out.
There was a reason why Windows had such a large market share. Even a noob who had never touched a computer before could easily use a full schematic operating system.
However, the Linux system was different. It was basically a command-line mode and everything could be done through the keyboard. Fortunately, the school installed a desktop version. Otherwise, Lu Zhou would not know what the mouse was for.
Of course, the advantages of Linux were obvious. The strong customizability and security made it more suitable for servers and other fields than Windows. Once the user was familiar with the command-line operation, the efficiency would be several times higher than Windows. Therefore, when companies were hiring server programmers, they would ask if they knew how to use Linux.
After familiarizing himself with the basic operation of the Linux system, Lu Zhou opened the Python software, opened the book, and sat in front of the computer in a daze.
"One of the uses of Python is to write a web crawler. If I want to test my learning results, this is the best place to start … But what crawler should I make?"
Lu Zhou could not help but think.
Crawl blog posts on Weibo?
Crawl posts on Tieba?
Seems pretty boring.
The key was that the crawled data was useless in his hands. He did not even have a place to put it.
Suddenly, his heart skipped a beat. For some reason, he recalled the painful experience of fighting for tickets every time he went home. It wasn't because his computer was lagging, but because the UI design of the Ministry of Railways' official website was too anti-human.
"Using crawler technology to crawl the 12306 website's various stations, train numbers, and remaining ticket data … This seems doable."
Thinking of this, Lu Zhou stopped dawdling and immediately started working.
After all, as a typical application example of the Python language, the crawler template was mentioned in the book. The book also made different improvements to the crawler algorithm for different situations.
Of course, 12306 wasn't an ordinary BBS forum after all. It was quite difficult for a beginner to practice on it.
However, it wasn't a big problem for Straight-A Student Lu, who had already understood the entire book. The crawler itself was not too technically difficult. It took less than 30 lines of code to complete the entire program, and it ran flawlessly without any bugs.
Then it was grabbing.
After copying the website's URL behind the code, Lu Zhou chose to run it. He then generated the data into a table and imported it into the pre-created folder.
Then the fan of the case began to buzz, and the computer became laggy. Lines of code flashed from the black dialog box and were quickly organized into the table.
Looking at the folder that was constantly being filled, Lu Zhou, who was leaning against the chair, felt emotional.
"The Python language is so f * cking convenient, no wonder so many experts recommend it."
Looking at the lines of data flashing by, Lu Zhou had an illusion that he was addicted to hacking.
But of course, it was just an illusion. It couldn't even be considered a feeling. After all, this thing had nothing to do with hacking. Crawling public information from the server was not illegal. At most, it would be suspected of occupying other people's server resources, which would be hated by major webmasters.
Therefore, many "stingy" websites would set up anti-crawler programs. Those with high technical content would either not be able to crawl anything, or all that was crawled down was garbled code. Those with low technical content could also monitor the number of visits and directly lock your IP address.
However, the 12306 website was obviously not that stingy. Think about it, a monopoly giant that did not even care about the user experience, why would it care about the server resources? As long as you don't destroy my server, who cares!
Lu Zhou looked at the continuous accumulation of bus data in the folder. He rolled his eyes and wondered if he should use it for something.
"Make a ticket-booking website? That sounds like taking off my pants and farting … "
Suddenly, Lu Zhou had an idea.
What if …
Make an online ticket-booking app?
Once this idea popped up, it uncontrollably took root in his mind.
Although there were many third-party ticket-booking apps on the Internet, there was no official ticket-booking app. If he could make a unique one and sell it to interested operators, he might be able to earn some living expenses.
When it came to money, Lu Zhou suddenly became interested. He began to calculate in his mind.
Technically, it was very difficult to independently develop an app from the front end to the back end. It was far more difficult than writing a simple crawler program, but it was not impossible. Not to mention, he could ask the system if he could not solve the problem. Spending general points to search for information was also a learning process.
Once he completed the reward mission and unlocked the artificial intelligence technology branch, the valuable experience would definitely come in handy.
However, it would probably cost a lot of money to buy and maintain a server. The electricity and various maintenance costs of the server would also be a large expense …
Also, he had less than ten thousand yuan in his card. It would be difficult for him to start a small business.
Lu Zhou clenched his teeth and decided to overcome these problems.
If he gave up a half a million yuan annual salary, what else couldn't he do?
Even if he failed, there was no harm in using it as practice for his lessons.
Therefore, Lu Zhou closed the program. He was not in a rush to change the code. Instead, he opened up a Word document and began to design the app development process like he was writing a thesis outline.
"The train ticket query must be done in real time, which requires high server performance. The code must be as concise as possible!
"The interface can be simple, but the information must be accurate and comprehensive. I can refer to third-party ticket-booking apps, but it can't be completely similar. There must be some innovation …"
Lu Zhou's index finger gently rubbed the keyboard. He thought for a long time before he continued to type.
"First is automatic ticket buying. This shouldn't be considered innovation. Cheetah, 360, and other browsers already had this feature a long time ago.
"But automatic ticket buying … I don't think I've seen it before." Lu Zhou thought back to last year's winter vacation when he was late in booking tickets. A few of his roommates sat in front of the computer and pressed f5 for almost half an hour before they managed to get a few tickets. Lu Zhou deeply felt that it was not easy for the masses to go home for Chinese New Year.
By constantly refreshing the official website, there was a certain probability that some tickets would appear. Some of them would be refunds from other users. Lu Zhou was not sure how some tickets appeared, but he could consider this feature.
For example, he could set a time period and a few train numbers. The server would automatically refresh the data for the user and submit the order the moment the tickets appeared. The few ticket-buying apps that he had seen so far did not have this feature.
In terms of algorithm, it didn't seem very difficult to implement.
Lu Zhou looked up at the clock on the wall.
It was one o 'clock in the afternoon!
Lu Zhou saved the Word document and rolled up his sleeves energetically. He then placed his hands on the keyboard.
You've already exceeded your reading limit for today. If you want to read more, please log in.
Login
Select text and click 'Report' to let us know about any bad translation.