Scholar’s Advanced Technological System

Chapter 47: Develop an APP to practice

The machine room was rather deserted, and no one was visible.

After all, it's summer vacation, and the postgraduate army generally don't need a computer.

I walked over and turned on the air conditioner. Lu Zhou randomly found a computer and sat down, entered his student ID and password, and logged into the computer skillfully.

选择 The reason why I chose the school's computer room is mainly because programs written in the python language are mainly run under the Linux system. Learning the python language directly in the Linux environment can serve two purposes.

And Lu Zhou's own second-hand notebooks are really too garbage. It will take a while to convert the paper to a pdf format, and play with it. Others have started to line up before he got on the fountain. It is not necessary to install dual systems or virtual machines. want.

虽然 "Although the book is very clear, I did not expect that this stuff is so cumbersome to use ... Sure enough, the things on the paper and the actual operation are completely different. I want to learn things by relying on practice."

舟 Lu Zhou, who was using Linux for the first time, felt only blindfolded. After reading the tutorials borrowed from the library for a while, he was able to figure out the way.

I have to say that it is reasonable for other windows systems to occupy such a large market share. Even a full-picture operating system can be easily used even if it has not touched the computer.

However, the Linux system is different. Basically it is a command line operation mode, and everything can be done through the keyboard. Fortunately, the school installed a distribution with a desktop environment. Otherwise, Luzhou really didn't know what the mouse was for.

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

Familiar with the basic operation of the Linux system, Lu Zhou opened the python software, opened the book, and sat in a daze in front of the computer.

"One of the uses of python is to write web crawlers. If you want to test the learning results, it is best to start from this ... but what kind of crawler do you want?"

Lu Zhou could not help but fall into meditation.

Climbing the blog post on the scarf?

Climbing posts?

I seem to be bored.

The key is that the data you climb down is useless in your hand, there is no place to put it.

Suddenly, as soon as he was in his heart, somehow he remembered the painful ticket-grabbing experience 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.

"Using crawler technology to crawl the data of each station, train number, and remaining tickets on the 12306 website ... This seems to work."

As soon as I thought about it, Lu Zhou no longer froze, and immediately began to work.

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 a general BBS forum after all. It is still difficult to use this as a target for beginners.

But it's just not small. For Lu Xueba, who has eaten 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 runs flawlessly without bugs.

Then grabbed immediately.

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

接着 Then the fan of the case started buzzing, the computer became frozen, the lines of code flashed from the black dialog box, and were quickly sorted into the form.

I looked at the constantly filled folders, and felt in Lu Zhou's heart leaning on the chair.

"Python is really convenient for Nima. No wonder so many big cows recommend this stuff."

Looking at the flashing information, Lu Zhou really had the illusion of hacking.

But of course, it's just an illusion. It doesn't even feel like it. After all, this thing and hacking technology are completely out of reach. It is against the law to crawl public information from the server. At most, there are suspicions of squeezing others' server resources, which will be hated by major webmasters.

Therefore, many "stupid" websites will be equipped with anti-crawling programs. The high-tech ones will either make you unable to crawl anything, or the crawling down will be garbled. The low-tech content can also be monitored directly by monitoring the number of visits and locked directly. Your ip.

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

Looking at the accumulated trip data in the folder, Lu Zhou's eyes rolled around, wondering if he would use it for something?

"Be a ticket booking site? It seems that some pants are farted ..."

Suddenly, Lu Zhou's heart moved.

Or ...

Be an online booking app?

一 As soon as this temporary thought came out, he could uncontrollably take root in his heart.

Although there are many third-party booking apps on the Internet, the official booking app does not exist. If he can make a difference and sell it to those interested operators, maybe he can earn some living expenses.

As soon as the issue of money was involved, Lu Zhou was instantly attentive, and his mind began to continually calculate.

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

Wait for him to complete the reward task and unlock the branch of artificial intelligence LV0 technology. These valuable experiences will definitely come in handy.

I'm just buying and maintaining a server, I'm afraid it will cost a lot of money, and the server's electricity and maintenance costs may be a lot of expense ...

Alas, his Cali is less than 10,000 yuan, I am afraid it is difficult to burn a small flame.

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

He even gave up 500,000 yuan in salary, what else could he not do?

Even if the streets are fluttering, it's okay to exercise power as a class.

是 So, Lu Zhou closed the program ~ www.readwn.com ~ and did not rush to start changing the code, but opened the word document, just like writing the outline of a thesis, and started to design the outline of the app development process.

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

"The interface can be simple, but the information must be accurate and comprehensive. This can refer to mainstream third-party booking apps, but it must not be completely similar. There must be innovation ..."

I wrote here, Lu Zhou's forefinger gently rubbed the keyboard, and after thinking for a long time, he continued to tap the keyboard.

"The first is automatic ticket grabbing. This should not be considered innovative. Long ago, Cheetah and 360 browsers already have this feature."

"But on-hook automatic ticket repurchase ... I haven't seen it before." Thinking of last year's winter vacation, the booking was late, and some animals in the bedroom pressed f5 for almost half an hour while sitting in front of the computer. With a few return tickets, Lu Zhou deeply felt that it was not easy for the masses of working people to go home during the New Year.

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

For example, set a time period and several trips, the server will help the user automatically refresh the data, and submit the order at the instant when the remaining tickets appear. As far as the ticket-snapping software he has seen, it seems that this function is not yet available.

Also, it seems that it is not difficult to implement algorithmically.

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

It's 1pm now!

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

"Start working!"

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like