<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How To Update Your Twitter Status With PHP and OAuth</title>
	<atom:link href="http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/feed/" rel="self" type="application/rss+xml" />
	<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/</link>
	<description>News , Reviews and Free Scripts For Developers</description>
	<lastBuildDate>Fri, 16 Oct 2009 12:47:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: enstine</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-74</link>
		<dc:creator>enstine</dc:creator>
		<pubDate>Sat, 03 Oct 2009 12:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-74</guid>
		<description>Hello,&lt;br&gt;Is there anywhere to have an animated preloader here?</description>
		<content:encoded><![CDATA[<p>Hello,<br />Is there anywhere to have an animated preloader here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enstine</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-75</link>
		<dc:creator>enstine</dc:creator>
		<pubDate>Sat, 03 Oct 2009 12:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-75</guid>
		<description>Hello,&lt;br&gt;Is there anywhere to have an animated preloader here?</description>
		<content:encoded><![CDATA[<p>Hello,<br />Is there anywhere to have an animated preloader here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enstine</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-73</link>
		<dc:creator>enstine</dc:creator>
		<pubDate>Sat, 03 Oct 2009 08:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-73</guid>
		<description>excccccccccccccccccccccccccellent!&lt;br&gt;&lt;br&gt;You just pull a string off my leg. Now I can continue&lt;br&gt;&lt;br&gt;thanks a million.</description>
		<content:encoded><![CDATA[<p>excccccccccccccccccccccccccellent!</p>
<p>You just pull a string off my leg. Now I can continue</p>
<p>thanks a million.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Alvarez</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-72</link>
		<dc:creator>Miguel Alvarez</dc:creator>
		<pubDate>Sat, 03 Oct 2009 08:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-72</guid>
		<description>You can&#039;t use friendshipsExists with EpiTwitter because the response twitter returns is not properly formatted (it&#039;s missing the line &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;)&lt;br&gt;&lt;br&gt;But you can do one of two things. BTW, they don&#039;t have to follow each other to be considered friends. But you can still check if they follow each other with option 2.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Option1:&lt;/strong&gt;&lt;br&gt;You can use file get contents, this returns a string &quot;true&quot; or &quot;false&quot;, but don&#039;t use the string as boolean, compare it to &quot;true&quot; instead.&lt;br&gt;&lt;br&gt;if(strip_tags(file_get_contents(&#039;http://twitter.com/friendships/exists.xml?user_a=username1&amp;user_b=username2&#039;))==&quot;true&quot;)&lt;br&gt;{&lt;br&gt; echo &quot;friends&quot;;&lt;br&gt;}&lt;br&gt;else&lt;br&gt;{&lt;br&gt; echo &quot;not friends&quot;;&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;strong&gt;Option 2:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;Use &quot;friendships/show&quot; instead of &quot;friendships/exists&quot;, this returns the previous information and more.&lt;br&gt;&lt;a href=&quot;http://apiwiki.twitter.com/Twitter-REST-API-Method:-friendships-show&quot; rel=&quot;nofollow&quot;&gt;http://apiwiki.twitter.com/Twitter-REST-API-Met...&lt;/a&gt;&lt;br&gt;&lt;br&gt;Here is an example.&lt;br&gt;$friend=$Twitter-&gt;get_friendshipsShow(array(&#039;source_screen_name&#039; =&gt; &#039;username1&#039;, &#039;target_screen_name&#039; =&gt; &#039;username2&#039;));&lt;br&gt;&lt;br&gt;// check if person  one follows person two&lt;br&gt;if($friend-&gt;relationship-&gt;source-&gt;following)&lt;br&gt;echo &quot;username1 is following&quot;;&lt;br&gt;else&lt;br&gt;echo &quot;username1 is not following&quot;;&lt;br&gt;&lt;br&gt;// check if username2 is following username1&lt;br&gt;if($friend-&gt;relationship-&gt;source-&gt;followed_by)&lt;br&gt;echo &quot;username2 is following&quot;;&lt;br&gt;else&lt;br&gt;echo &quot;username2 is not following&quot;;&lt;br&gt;&lt;br&gt;you can also use id&#039;s instead of usernames with &quot;user_id&quot; and &quot;target_id&quot; in the array.</description>
		<content:encoded><![CDATA[<p>You can&#39;t use friendshipsExists with EpiTwitter because the response twitter returns is not properly formatted (it&#39;s missing the line &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;)</p>
<p>But you can do one of two things. BTW, they don&#39;t have to follow each other to be considered friends. But you can still check if they follow each other with option 2.</p>
<p><strong>Option1:</strong><br />You can use file get contents, this returns a string &#8220;true&#8221; or &#8220;false&#8221;, but don&#39;t use the string as boolean, compare it to &#8220;true&#8221; instead.</p>
<p>if(strip_tags(file_get_contents(&#39;<a href="http://twitter.com/friendships/exists.xml?user_a=username1&#038;user_b=username2&#038;#39" rel="nofollow">http://twitter.com/friendships/exists.xml?user_a=username1&#038;user_b=username2&#038;#39</a> <img src='http://webhole.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )==&#8221;true&#8221;)<br />{<br /> echo &#8220;friends&#8221;;<br />}<br />else<br />{<br /> echo &#8220;not friends&#8221;;<br />}</p>
<p><strong>Option 2:</strong></p>
<p>Use &#8220;friendships/show&#8221; instead of &#8220;friendships/exists&#8221;, this returns the previous information and more.<br /><a href="http://apiwiki.twitter.com/Twitter-REST-API-Method:-friendships-show" rel="nofollow">http://apiwiki.twitter.com/Twitter-REST-API-Met&#8230;</a></p>
<p>Here is an example.<br />$friend=$Twitter-&gt;get_friendshipsShow(array(&#39;source_screen_name&#39; =&gt; &#39;username1&#39;, &#39;target_screen_name&#39; =&gt; &#39;username2&#39;));</p>
<p>// check if person  one follows person two<br />if($friend-&gt;relationship-&gt;source-&gt;following)<br />echo &#8220;username1 is following&#8221;;<br />else<br />echo &#8220;username1 is not following&#8221;;</p>
<p>// check if username2 is following username1<br />if($friend-&gt;relationship-&gt;source-&gt;followed_by)<br />echo &#8220;username2 is following&#8221;;<br />else<br />echo &#8220;username2 is not following&#8221;;</p>
<p>you can also use id&#39;s instead of usernames with &#8220;user_id&#8221; and &#8220;target_id&#8221; in the array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enstine</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-71</link>
		<dc:creator>enstine</dc:creator>
		<pubDate>Sat, 03 Oct 2009 07:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-71</guid>
		<description>Hi Miguel,&lt;br&gt;Thanks very much for the corrections.&lt;br&gt;Please one more thing... before I follow someone, I&#039;d like to check if I&#039;m already following that person. How is that done. If I understand well, users are said to be friends if they both follo each other&lt;br&gt;$twitter-&gt;get_friendshipsExists(array(&#039;user_a&#039; =&gt; $id_a, &#039;user_b&#039; =&gt; $id_b));  &lt;br&gt;&lt;br&gt;But I&#039;d like just to check if I&#039;m already following...</description>
		<content:encoded><![CDATA[<p>Hi Miguel,<br />Thanks very much for the corrections.<br />Please one more thing&#8230; before I follow someone, I&#39;d like to check if I&#39;m already following that person. How is that done. If I understand well, users are said to be friends if they both follo each other<br />$twitter-&gt;get_friendshipsExists(array(&#39;user_a&#39; =&gt; $id_a, &#39;user_b&#39; =&gt; $id_b));  </p>
<p>But I&#39;d like just to check if I&#39;m already following&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Alvarez</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-70</link>
		<dc:creator>Miguel Alvarez</dc:creator>
		<pubDate>Sat, 03 Oct 2009 03:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-70</guid>
		<description>There was clearly a mistake in my javascript when assigning the value of the text field to a variable, sorry about that. (now it&#039;s fixed)&lt;br&gt;&lt;br&gt;The line&lt;br&gt;		status:$(&quot;#status&quot;).val();&lt;br&gt;&lt;br&gt;should be &lt;br&gt;               status=$(&quot;#status&quot;).val();&lt;br&gt;&lt;br&gt;That should work now.&lt;br&gt;&lt;br&gt;To follow some one use&lt;br&gt;&lt;br&gt;$friend=$Twitter-&gt;post_friendshipsCreate(array(&#039;screen_name&#039; =&gt; &#039;username&#039;));&lt;br&gt;$friend-&gt;response;&lt;br&gt;&lt;br&gt;To unfollow&lt;br&gt;$friend=$Twitter-&gt;post_friendshipsDestroy(array(&#039;screen_name&#039; =&gt; &#039;username&#039;));&lt;br&gt;$friend-&gt;response;</description>
		<content:encoded><![CDATA[<p>There was clearly a mistake in my javascript when assigning the value of the text field to a variable, sorry about that. (now it&#39;s fixed)</p>
<p>The line<br />		status:$(&#8220;#status&#8221;).val();</p>
<p>should be <br />               status=$(&#8220;#status&#8221;).val();</p>
<p>That should work now.</p>
<p>To follow some one use</p>
<p>$friend=$Twitter-&gt;post_friendshipsCreate(array(&#39;screen_name&#39; =&gt; &#39;username&#39;));<br />$friend-&gt;response;</p>
<p>To unfollow<br />$friend=$Twitter-&gt;post_friendshipsDestroy(array(&#39;screen_name&#39; =&gt; &#39;username&#39;));<br />$friend-&gt;response;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enstine</title>
		<link>http://webhole.net/2009/09/24/how-to-post-to-twitter-from-a-scrip/comment-page-1/#comment-67</link>
		<dc:creator>enstine</dc:creator>
		<pubDate>Fri, 02 Oct 2009 11:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://webhole.net/?p=376#comment-67</guid>
		<description>hello,&lt;br&gt;This is a great help to me given that I&#039;m doing this oauth for my first time. When I try the post as you explained here, I get the word &#039;undefined&#039; posted. Please help to correct that.&lt;br&gt;&lt;br&gt;Secondly, how can I follow someone using this script?</description>
		<content:encoded><![CDATA[<p>hello,<br />This is a great help to me given that I&#39;m doing this oauth for my first time. When I try the post as you explained here, I get the word &#39;undefined&#39; posted. Please help to correct that.</p>
<p>Secondly, how can I follow someone using this script?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

