Scholar’s Advanced Technological System

Chapter 47 Develop an App to Practice Hands

The computer room was quite deserted, and there was not a single person in sight.

After all, this is the summer vacation, and the postgraduate army generally does not have access to computers.

Walking over to turn on the air conditioner, Lu Zhou casually found a machine and sat down, entered his student ID and password, and logged into the computer proficiently.

The reason why I chose the school's computer room is mainly because the programs written in the python language are mainly run under the Linux system. It can be said that learning the python language directly in the Linux environment can kill two birds with one stone.

And Lu Zhou's own second-hand notebook is too rubbish, the paper will have to be suspended for a while to convert it to pdf format, and he will stand on the spring water when everyone else starts to line up, and there is no need to install dual systems or virtual machines. want.

"Although it's clearly explained in the book, I didn't expect it to be so troublesome to use... Sure enough, what's on paper and how to operate it are completely different things. If you want to learn something, you still have to rely on practice."

Lu Zhou, who was using the Linux system for the first time, only felt that his eyes were blind. After reading the instructions and tutorials borrowed from the library for a while, he finally understood the way.

I have to say that it makes sense that other people's Windows systems occupy such a large market share. Even a novice who has never touched a computer can easily get started with a full-graphics operating system.

However, the Linux system is different. It is basically a command-line operation mode, and everything can be done through the keyboard. Fortunately, the school installed a release version with a desktop environment, otherwise Lu Zhou really didn't know the use of the mouse.

Of course, the advantages of Linux are also obvious. Its strong customizability and security make it more suitable for servers and other fields than the windows system. And once you are familiar with the command line operation, the efficiency will be several times higher than that of the windows system. Therefore, many companies will ask when recruiting front-end and back-end programmers for servers, whether they will use Linux systems.

Familiar 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 applications of python is to write a web crawler. If you want to test the learning results, it is the best to start from this... But what kind of crawler?"

Lu Zhou couldn't help but fell into contemplation.

Climbing the blog post on the scarf?

Crawling Posts?

It seems kind of boring.

The key is that the data that has climbed down is useless in the hand, and there is no place to put it.

Suddenly, his heart moved, and somehow he recalled the painful experience of robbing tickets every time he went home. Not because of his computer card, but because the UI design of the official website of the Ministry of Railways is too anti-human.

"Use crawler technology to crawl the data information of stations, trains, and remaining tickets on the 12306 website... This seems to be feasible."

Thinking of this, Lu Zhou stopped dawdling and started working immediately.

After all, as a typical application example of the python language, the template of the crawler program is mentioned in the book, and for different situations, the book also improves the algorithm to varying degrees.

Of course, 12306 is not an ordinary BBS forum after all, so it is not difficult to take this as a practice target for beginners.

But it's not too small. For Lu Xueba, who has already read the whole book, the problem is not big. The crawler itself is not too technically difficult. The entire program is completed in less than 30 lines of code, and it runs perfectly without bugs.

Then came the grab.

Copy the url of the website behind the code, Lu Zhou chooses to run, and generates a table of data and imports it into a pre-built folder.

Immediately afterwards, the fan of the chassis began to hum, the computer became stuck, and lines of codes flashed through the black dialog box and were quickly sorted into tables.

Looking at the folders that were constantly being filled, Lu Zhou, who was leaning on the chair, sighed in his heart.

"The python language is really convenient, no wonder so many big cows recommend this stuff."

Looking at the information flashed by rows of data, Lu Zhou really had the illusion that he was addicted to hackers.

But of course, it's just an illusion, not even a feeling. After all, this thing has nothing to do with hacking technology. It is not illegal to crawl public information from the server. At most, it is suspected of occupying other people's server resources, which will be hated by major webmasters.

Therefore, many "stingy" websites will be equipped with anti-crawler programs. Those with high technology will either make you unable to climb anything or climb down with garbled characters. Those with low technology content can also be monitored by the number of visits and locked directly. your ip.

However, the 12306 website is obviously not so stingy. Think about a monopoly giant who doesn't even care about user experience. Would he care about that little server resource? As long as you don't mess with Lao Tzu's server, who cares about you!

Looking at the accumulation of trip data in the folder, Lu Zhou rolled his eyes and wondered if he should use it for something?

"Being a ticket booking website? It seems that some have taken off their pants and farted..."

Suddenly, Lu Zhou's heart moved.

or……

An app for online booking?

As soon as this impromptu idea came up, it took root in his heart uncontrollably.

Although there are many third-party booking apps on the Internet, there is really no official booking app. If he can make a different one and sell it to those interested operators, maybe he can earn some living expenses.

When it came to the issue of money, Lu Zhou immediately became concerned, and began to ponder in his heart.

Technically, it is very difficult to independently complete the development of an app from the front end to the back end. It is far from being comparable to writing a simple crawler program, but it is not impossible. What's more, the algorithm that cannot be solved can still be asked by the system, and consuming points to query data is also a learning process itself.

When he completes the reward task and unlocks the branch technology of artificial intelligence LV0, these valuable experiences will definitely come in handy.

It's just that buying and maintaining a server may cost a lot of money, and the electricity bill and various maintenance costs for operating the server may also be a small expense...

And his card is less than 10,000 yuan, I am afraid it will be difficult to burn a small flame.

After gritting his teeth, Lu Zhou decided to overcome these difficulties.

Even giving up the annual salary of 500,000, what else can't be done?

Even if he is on the street, Quan should be doing lessons and training his hands.

So, Lu Zhou closed the program, and did not rush to start changing the code, but opened the word document, just like writing the outline of the paper, and began to design the outline of the development process of the app.

"Train ticket query must crawl real-time data, which requires high performance of the server, and the code must be as concise as possible!"

"The interface can be simple, but the information must be accurate and comprehensive. You can refer to mainstream third-party booking apps for this, but it must not be completely similar, and there must be innovations..."

Writing this, Lu Zhou's index finger gently rubbed the keyboard, thinking for a long time before continuing to type on the keyboard.

"The first is automatic ticket grabbing. This should not be regarded as an innovation. Cheetah and 360 browsers already had this function a long time ago."

"But the ticket is automatically swiped when you hang up the phone... I don't think I've seen it before." Thinking that during the winter vacation last year, the booking was late, and a few animals in the dormitory sat in front of the computer and pressed F5 for almost half an hour before they swiped. After a few tickets to go back, Lu Zhou deeply felt that it was not easy for the vast majority of the toiled people to go home for the New Year.

By constantly refreshing the official website data, there is a certain metaphysical probability that some tickets will be generated, some of which are refunded by other users, and some Lu Zhou are not sure how they came out, but this function can be considered.

For example, set a time period and several trains, and the server will automatically refresh the data for the user, and submit the order at the moment when the remaining tickets appear. As far as the few ticket grabbing software he has seen so far, it seems that this function does not yet exist.

And algorithmically, it doesn't seem to be difficult to implement.

Thinking of this, Lu Zhou looked up at the wall clock.

It's 3pm now!

After saving the word document, Lu Zhou vigorously rolled up his sleeves and put his hands on the keyboard.

"Get to work!"

Put bowls, ask for tickets every day~~~~~

Chapter 47/1702
2.76%
Scholar’s Advanced Technological SystemCh.47/1702 [2.76%]