Extract the content of the webpage---urgent----super simple

Source: Internet
Author: User
I want to crawl the content of the site is this http://api.94qing.com/, such as the input solution dream to get the content after submission, how can I do ah, directly according to the website API operation prompt to get content, do not know why???


Reply to discussion (solution)

Have the answer to the knot immediately


$url = "http://api.94qing.com/?type=alexa&msg=111";
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_connecttimeout, 10);
$content = curl_exec ($ch);

Need to pass cookies
Give a special function

function Qqlite_get ($msg, $type = ' jm ') {  $url = ' http://api.94qing.com ';  $cookiejar = Realpath (' cookie.txt ');  $ch = Curl_init ();  curl_setopt ($ch, Curlopt_url, $url);  curl_setopt ($ch, Curlopt_timeout, 5);  curl_setopt ($ch, curlopt_useragent, $_server[' http_user_agent ');  curl_setopt ($ch, Curlopt_referer, $url);  curl_setopt ($ch, Curlopt_cookiejar, $cookiejar);  curl_setopt ($ch, Curlopt_returntransfer, 1);  curl_setopt ($ch, curlopt_followlocation, true);  $r = curl_exec ($ch);  curl_setopt ($ch, Curlopt_url, "$url type= $type &msg= $msg");  curl_setopt ($ch, Curlopt_cookiefile, $cookiejar);  $r = curl_exec ($ch);  Curl_close ($ch);  return $r;} echo qqlite_get (' Tiger '); Chinese to Utf-8 encoded echo qqlite_get (' elephant ');
Your search for the solution Dream keyword: Tiger
The results of the solution are as follows:
1. Zhou Gong Meng public number
2. Account Number: Magicstaff
3. Men dream of tigers?? Difficulties will be encountered on the road to success.
4. Women dream of tigers?? Both oneself and the child will be ill.
5. Dreaming of tigers coming to themselves?? will be difficult.
6. Dreaming of shooting tigers?? Business will succeed.
7. Dream of catching tigers?? It is on the bad omen that friends will be enemies of themselves.
8. Dreaming of tigers jumping on other animals?? Will be worried about the situation of friends.
9. Dreaming of tigers jumping on others? There will be a major car accident, but it can be survived.

Your search for the solution Dream keyword: Elephant
The results of the solution are as follows:
1. Zhou Gong Meng public number
2. Account Number: Magicstaff
3. Dream of an elephant, The Omen succeeds, the fame is very noisy.
4. Dream of riding an elephant, social status has been improved.
5. Dreaming of angry elephants rushing towards themselves, only perseverance can make a fortune.
6. Dream that only one tooth elephant, only concentrate on the business, can make a lot of money.
7. Dreaming of elephants spoil trees, will soon tide over the difficulties.
8. Dreaming of elephants kicking the lions with their feet is auspicious and can defeat their formidable opponents.
9. Dream of the Wild Elephant group, all efforts can be successful.
10. Married women dream of playing with a little elephant and have a beautiful boy.

This I used to have, the address seems to be: http://api.qqlite.org

Wow, Moderator, I'll try it right away.

http://api.94qing.com/is there any limit to this interface? or in which case would you not be able to use it?

The moderator method can be implemented, but not in Bae

Need to pass cookies
Give a special function

function Qqlite_get ($msg, $type = ' jm ') {  $url = ' http://api.94qing.com ';  $cookiejar = Realpath (' cookie.txt ');  $ch = Curl_init ();  curl_setopt ($ch, Curlopt_url, $url);  curl_setopt ($ch, Curlopt_timeout, 5);  curl_setopt ($ch, curlopt_useragent, $_server[' http_user_agent ');  curl_setopt ($ch, Curlopt_referer, $url);  curl_setopt ($ch, Curlopt_cookiejar, $cookiejar);  curl_setopt ($ch, Curlopt_returntransfer, 1);  curl_setopt ($ch, curlopt_followlocation, true);  $r = curl_exec ($ch);  curl_setopt ($ch, Curlopt_url, "$url type= $type &msg= $msg");  curl_setopt ($ch, Curlopt_cookiefile, $cookiejar);  $r = curl_exec ($ch);  Curl_close ($ch);  return $r;} echo qqlite_get (' Tiger '); Chinese to Utf-8 encoded echo qqlite_get (' elephant ');
Your search for the solution Dream keyword: Tiger
The results of the solution are as follows:
1. Zhou Gong Meng public number
2. Account Number: Magicstaff
3. Men dream of tigers?? Difficulties will be encountered on the road to success.
4. Women dream of tigers?? Both oneself and the child will be ill.
5. Dreaming of tigers coming to themselves?? will be difficult.
6. Dreaming of shooting tigers?? Business will succeed.
7. Dream of catching tigers?? It is on the bad omen that friends will be enemies of themselves.
8. Dreaming of tigers jumping on other animals?? Will be worried about the situation of friends.
9. Dreaming of tigers jumping on others? There will be a major car accident, but it can be survived.

Your search for the solution Dream keyword: Elephant
The results of the solution are as follows:
1. Zhou Gong Meng public number
2. Account Number: Magicstaff
3. Dream of an elephant, The Omen succeeds, the fame is very noisy.
4. Dream of riding an elephant, social status has been improved.
5. Dreaming of angry elephants rushing towards themselves, only perseverance can make a fortune.
6. Dream that only one tooth elephant, only concentrate on the business, can make a lot of money.
7. Dreaming of elephants spoil trees, will soon tide over the difficulties.
8. Dreaming of elephants kicking the lions with their feet is auspicious and can defeat their formidable opponents.
9. Dream of the Wild Elephant group, all efforts can be successful.
10. Married women dream of playing with a little elephant and have a beautiful boy. Realpath is a good function!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.