<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Tutorials &#187; twitter</title>
	<atom:link href="http://phpcollection.com/category/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpcollection.com</link>
	<description>PHP Tutorials collection</description>
	<lastBuildDate>Tue, 12 Jul 2011 11:53:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Twitter bot tutorial</title>
		<link>http://phpcollection.com/twitter-bot/</link>
		<comments>http://phpcollection.com/twitter-bot/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:37:16 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Bot]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=550</guid>
		<description><![CDATA[Twitter is heavily becoming a source of traffic and with there extremely powerful api , it&#8217;s very easy to automate stuff via Twitter bots. Today i am going to show you a tutorial for very simple but yet very powerful bot which if used effectively can drive great traffic on sites. These bots simply search [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Twitter is heavily becoming a source of traffic and with there extremely powerful api , it&#8217;s very easy to automate stuff via Twitter bots.</p>
<p>Today i am going to show you a tutorial for very simple but yet very powerful bot which if used effectively can drive great traffic on sites. These bots simply search twitter stream for predefined keywords and tweet target messages to the tweeters. These bots can be set via cron to read stream every few minutes and make responses in real time.</p>
<p>For newbies and starters all Twitter API documentation can be found <a href="http://apiwiki.twitter.com/Twitter-API-Documentation">here</a> , From here we are going to use Search API methods and Status Update REST api method for sending predefined tweets to the users.<br />
<span id="more-550"></span><br />
Search API can give output both in JSON and ATOM(XML) format , And can take several parameters for searching twitter stream. We are going to use just the query(q) parameter to provide keyword to the search ,A complete parameter list can be found <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search">here </a> .</p>
<p>So , Let&#8217;s take the parameter query as PHP problem and send them our link of phpcollection.com in the tweet. For this we will first search the twitter stream for the keyword PHP problem</p>
<pre class="php">
< ?php
$url = "http://search.twitter.com/search.atom?q=urlencode(PHP+problem)";
</pre>
<p>The response of this query is in a XML format so we will use simplexml PHP extension for converting this XML data in native PHP object. simplexml_load_file function loads and converts xml data directly from the url. It can be easily then traversed via a Php object.</p>
</pre>
<pre class="php">
$data = simplexml_load_file($url);
</pre>
<p>Now the data can be traversed via a foreach loop , $data->entry contains a array of all tweet entries. We will take them one by one in $value. Tweet username can be accessed via $value->author->uri to whom we will be tweeting the predefined message.</p>
<pre class="php">
foreach ($data->entry as $value)
{
	$from_name = $value->author->uri;
	$from_name = str_replace ("http://twitter.com/", "", $from_name);
    	$message = "@$from_name Hey Buddy you can find solution to your problems at http://www.phpcollection.com #php";
</pre>
<p>Now we have the users who are looking for help in PHP language (via PHP problem keyword), Now using Twitter PHP wrapper we will tweet this message to the users. This can be easily achieved via CURL, However for the sake of the tutorial we will use <a href="http://www.phpcollection.com/classes/mytwitter.php.zip">mytwitter php class</a> for tweeting back to users.</p>
<pre class="php">
		require_once( 'mytwitter.php' );
		$twitter =  new MyTwitter('phpcollection', '**********');
 		$result = $twitter->updateStatus($message);
}
?>
</pre>
<p>Complete code can be <a href="http://www.phpcollection.com/classes/twitter_bot.php.zip">downloaded here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/twitter-bot/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>TwitterGadget &#8212; Integrate Twitter client into your Gmail/Google Apps account</title>
		<link>http://phpcollection.com/twittergadget-integrate-twitter-client-into-your-gmailgoogle-apps-account/</link>
		<comments>http://phpcollection.com/twittergadget-integrate-twitter-client-into-your-gmailgoogle-apps-account/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 17:00:33 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[gmail]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[TwitterGadget]]></category>

		<guid isPermaLink="false">http://phpcollection.com/?p=5</guid>
		<description><![CDATA[I have been addicted to twitter and thus tweetdeck for a long time now , But the heavy dosage of ram taken by tweetdeck (along with the notifications) was always a off to me. Two essential things you will find running on my desktop are Google Apps (On firefox ) and Tweetdeck (as a program), [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have been addicted to twitter and thus tweetdeck for a long time now , But the heavy dosage of ram taken by tweetdeck (along with the notifications) was always a off to me.</p>
<p><span id="more-5"></span></p>
<p>Two essential things you will find running on my desktop are Google Apps (On firefox ) and Tweetdeck (as a program), And thus idea of integrating both functionalities into one was just irrestitable .</p>
<p><a href="http://twittergadget.com">TwitterGadget</a> is a awesome piece of opensocial gadget that integrates into your gmail interface. Replies and DM&#8217;s are highlighted with a different colour (Overall it has same look and feel of Twirhl).</p>
<p>Since it&#8217;s on opensocial you can easily integrate it with igoogle, gmail and google apps. Choose whatever you want.</p>
<p>Here&#8217;s a quick 5 steps intro for installing twittergadget on google apps account. <a title="http://www.twittergadget.com/how_to_install.html" href="http://www.twittergadget.com/how_to_install.html">http://www.twittergadget.com/how_to_install.html</a></p>
<p>Enjoy&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/twittergadget-integrate-twitter-client-into-your-gmailgoogle-apps-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate twitter with your blog</title>
		<link>http://phpcollection.com/integrate-twitter-with-your-blog/</link>
		<comments>http://phpcollection.com/integrate-twitter-with-your-blog/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 06:45:58 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[twitter]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[movable type]]></category>

		<guid isPermaLink="false">http://gauravmishra.info/2008/04/06/integrate-twitter-with-your-blog/</guid>
		<description><![CDATA[Here is a nice and quick way to integrate twitter with your wordpress blog . 1. Download twitter-tools from http://downloads.wordpress.org/plugin/twitter-tools.1.1b1.zip 2. Extract it into wp-content/plugins/ folder and activate it from dashboard , After enabling it just activate features of twitter-tools from Options menu ( I have activated tweeting on my each blog post, That`s great. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here is a nice and quick way to integrate twitter with your wordpress blog .</p>
<p>1. Download twitter-tools from <a href="http://downloads.wordpress.org/plugin/twitter-tools.1.1b1.zip">http://downloads.wordpress.org/plugin/twitter-tools.1.1b1.zip </a></p>
<p>2. Extract it into wp-content/plugins/ folder and activate it from dashboard , After enabling it just activate features of twitter-tools from Options menu</p>
<p>( I have activated tweeting on my each blog post, That`s great. And all my daily tweets get digested and made into a new blog post each day, Awesome)</p>
<p>Let me know what changes you all are looking into it !</p>
<p>Update: Inegrating Movable type with  twitter <a href="http://www.chopstixmedia.com/mt-twitter/">http://www.chopstixmedia.com/mt-twitter/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/integrate-twitter-with-your-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

