[] Zero-based Polar Star quantify Getting XI: The simple way remote control

I. Introduction

  Front pushed through the micro-channel achieved a number of important public information, there are children's shoes asked, that can not pass the policy micro-channel remote control it? For example, start, pause, stop, and so on?

  Baidu under, the previous two years can be done, if there are some basics of programming by micro-channel public number also can be done, but play quantify children's shoes are not native to most programmers, so do not be too complicated.

  So I thought of a more "earth", but also relatively easy way to achieve.

  simply put:

    1) You have to have a blog, you can modify or edit any of 'pages'.

    2) In the pole star quantified by requests module is still above said GET "You can modify the page"

    3) Now you can use the Polar Star quantization requests to read "You can modify the page" content, you can write a "start", and then start on the implementation of the code, write a "stop", the code execution stops

Second, the realization

  1, to find a web page that can be modified

  This step is the most important, a lot of children's shoes might not want to understand that the pole star quantify how code execution associated with a web page together? In fact, a little children's shoes will know the basis of requests can read the content on the page, so if you can modify the contents of a page, and through requests to read, and finally quantify the pole star to make a judgment before the code is executed, that does not it is easy to achieve a "remote control"?

  Here I will use my own blog, the page linked below

  https://www.cnblogs.com/cation/p/12663703.html

  I have written a code word, should be noted that, due to the page content like blog sites is more complex, Paul missing on a "start", "stop" this type of word, so your best code word is a complex point, For example, I have this very complicated:

 

   And Paul missing some enthusiastic people behind the comment, do you quantify paralysis on the bad, so stop argot best not similar with the code word to start, for example, we can use:

  Rumble quack "Stop"!

  Or you can just write some confusing strong, such as:

  Xiao Ming to eat three burgers Han

  2, to make a judgment before the code is executed

  Now we are ready argot of the page, and then they do something simple like a judge, we know that most stars quantified in the market triggered every time you perform a handle_data function, so that the implementation of quantitative strategies handle_data in place, then the code word judgment on handle_data on the front can be.

  

 

  3, operating results and problems

  After running strategy, a start log output is "here to enforce policy," when I will blog content was revised to "rumble quack" stop "!" Next trigger is the "strategy to stop" handle_data the output.

  Of course this approach is very simple, but it has a flaw, that is, the site may not allow you too high frequency of visit . Use get requests every content page, it is a visit to the site, some sites may limit the number of visits Japan (who do not know the specific number). So if your strategy a relatively high frequency (such as once every few seconds), it is better not to use this approach. If it is 5 minutes or more strategies, general site will not have too many restrictions.

  Second, Paul missing these sites you visit can not fail, so you can be more prepared to consider a few sites, to make a judgment several times to ensure that OK.

   Basic children's shoes can also rent a server to put forward a WEB service to do a similar thing, but to rent their own server may not be as prepared to find a few blog yet.

Third, review

  This section with a simple way to achieve remote control of the operation pole star quantization codes, in addition to starting, stopping, in fact, can do more applications, which requires you to launch the brain. Combined before a "vital information pushed to micro-letters", we have implemented a notification -> Control -> closed-loop notification. Sometimes policy strategy does not say that this little application quite interesting.

  Public concern number "zero-based love learning" Reply "LH13" get code examples.

 

Guess you like

Origin www.cnblogs.com/cation/p/12663959.html