<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Http Bot class in PHP'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Thu, 23 Apr 2026 01:21:34 +0000</lastBuildDate>
    <item>
      <title>Sn0opy said on 11/Jun/2008</title>
      <link>https://snipplr.com/view/6649/http-bot-class-in-php</link>
      <description>&lt;p&gt;&lt;p&gt;What does this bot do?&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 02:15:31 UTC</pubDate>
      <guid>https://snipplr.com/view/6649/http-bot-class-in-php</guid>
    </item>
    <item>
      <title>dereklio said on 11/Jun/2008</title>
      <link>https://snipplr.com/view/6649/http-bot-class-in-php</link>
      <description>&lt;p&gt;&lt;p&gt;i have never thought there is someone comments on my codes, as i am just putting some of my frequently used snippets online ;)&lt;/p&gt;

&lt;p&gt;in short, it does nothing. This class basically is a wrapper of the HTTP&lt;em&gt;Client PEAR package. it just groups several functions of the HTTP&lt;/em&gt;Client which i used very frequently together. and it's needed to be used in conjunction of my other class "Shell.class.php" (http://snipplr.com/view/6648/a-shell-access-wrapper-for-windows-in-php/)&lt;/p&gt;

&lt;p&gt;let's say, I want to write a script that log me into facebook and write something on someone's else wall.... I would simply do:&lt;/p&gt;

&lt;p&gt;$http = HttpBot::singleton();
$http-&gt;geta('http://www.facebook.com', 'Unable to connect to Facebook');
if ($http-&gt;contenta('logout') === false) {
    // Login required, login now!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;list($dom, $xpath) = $http-&gt;response();

$challenge = $dom-&gt;getElementById('challenge')-&gt;getAttribute('value');
$data = array(
    'email' =&gt; USERNAME,
    'pass' =&gt; PASSWORD,
    'challenge' =&gt; $challenge,
    'md5pass' =&gt; '1',
    'noerror' =&gt; '1',
);
$http-&gt;posta(https://login.facebook.com/login.php, $data, 'Unable to login');
$http-&gt;contenta('logout', 'Login failed');
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;i used this script to create several scheduled tasks in windows to collect / poll different contents from internet, summarize and email to me on a daily basis. it may not be a very elegant solution, but it just gives me some shorthand, while dealing with the HTTP_Client class.&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 02:45:49 UTC</pubDate>
      <guid>https://snipplr.com/view/6649/http-bot-class-in-php</guid>
    </item>
  </channel>
</rss>
