Home >Backend Development >PHP Tutorial >The Fetion interface I wrote myself supports crontab and is shared with everyone for free!

The Fetion interface I wrote myself supports crontab and is shared with everyone for free!

WBOY
WBOYOriginal
2016-07-25 09:07:51988browse
I saw the Fetion interface released by someone before. It's not about wine. It's just for selling money. It's BS. . .

I took the time to write one and share it with everyone. Everyone can point out the bad parts and discuss and learn together.

Requirements: Must be mobile users, and secondly, they need to be Fetion friends. No matter how you play the game, the rules of the game cannot be violated.

================================================= ============

The project description is as follows:
index.php => Entry page for sending Fetion online
demo.php => Project demo page. It is recommended to use demo.php for the first time to test whether the program is running normally.
cron.php => A script used to regularly send some messages to Fetion friends
weather_php.bat => Open it with notepad and read the comments inside. Use it with cron.php
weather_php.vbs => vbs script, used in conjunction with the weather_php.bat batch process above, its main function is to hide the command window when the batch process is executed
class.fetion.php => I won’t go into details about this, the core file depends on him.

Others:
If you want cron.php to be executed regularly, Windows users must of course use "scheduled tasks". Just add a task yourself and run weather_php.vbs regularly.

If you are a Linux user, you can use /etc/crontab and then write a shell script yourself. You can research this yourself~


The relevant stuff is all in the compressed package, and I also noted the usage instructions in the readme.txt~

================================================= ===============
Online demo address: http://feixin.cxxmv.com:81

The last second line of the sendmsg.php page is modified to: echo Fetion::sendMsg($fid, $msgContent); There is an echo missing in front, otherwise you will not see the sending result. grateful" Huangbo SEEVIA” Feedback
  1. set_time_limit(0);
  2. date_default_timezone_set('PRC');
  3. include 'class.fetion.php';
  4. #============= CURL Get Third-party data, please modify it yourself [To put it bluntly, it is just collecting data, a thief program~! ] =============
  5. $ch = curl_init('http://www.weather.com');
  6. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01 ; Windows NT 5.0)");
  7. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  9. curl_setopt($ch, CURLOPT_HEADER, 0);
  10. $result = curl_exec($ch) ;
  11. curl_close($ch);
  12. if(!$result) {
  13. exit;
  14. }
  15. preg_match('/(.*)