<?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>jtGraphic: James Thompson &#187; curl_setopt</title>
	<atom:link href="http://www.jtgraphic.net/tag/curl_setopt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jtgraphic.net</link>
	<description>I can help you get where you want to go on the Internet.  We&#039;ll have fun along the way too.</description>
	<lastBuildDate>Mon, 26 Jul 2010 12:00:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The Twitter API</title>
		<link>http://www.jtgraphic.net/2010/02/twitter-api/</link>
		<comments>http://www.jtgraphic.net/2010/02/twitter-api/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:15:06 +0000</pubDate>
		<dc:creator>James Thompson</dc:creator>
				<category><![CDATA[Insights]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[curl_close]]></category>
		<category><![CDATA[curl_exec]]></category>
		<category><![CDATA[curl_init]]></category>
		<category><![CDATA[curl_setopt]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tidbit Tuesday]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.jtgraphic.net/?p=493</guid>
		<description><![CDATA[
			
				
			
		
<p>I&#8217;ve been messing with the Twitter API for the first time in the last few hours, and I&#8217;ve learned a TON.  I know &#8211; I&#8217;m jumping on the bandwagon late, but oh well.  I managed to create a script to retweet &#8220;stuff&#8221; based on the search functionality and I made a script to automatically follow people <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.jtgraphic.net/2010/02/twitter-api/">The Twitter API</a></span><p><a href="http://www.jtgraphic.net/2010/02/twitter-api/">The Twitter API</a> is a post from: <a href="http://www.jtgraphic.net">jtGraphic: James Thompson</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;source=jtgraphic&amp;style=normal&amp;service=bit.ly&amp;hashtags=API,curl_close,curl_exec,curl_init,curl_setopt,PHP,Tidbit+Tuesday,Twitter" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been messing with the Twitter API for the first time in the last few hours, and I&#8217;ve learned a TON.  I know &#8211; I&#8217;m jumping on the bandwagon late, but oh well.  I managed to create a script to retweet &#8220;stuff&#8221; based on the search functionality and I made a script to automatically follow people that post specific things.  I also managed to get my account suspended in like 2 hours due to suspicious activity &#8211; whoops.  I guess you live, you learn.  Basically everything for status updates and following uses CURL, which looks a little something like this:</p>
<pre class="brush: php">&lt;?php
 $username = "&lt;username&gt;";
 $password = "&lt;password&gt;"; t t
 $message = "&lt;message content&gt;";
 $url = '&lt;API URL&gt;';
 $curl_handle = curl_init();
 curl_setopt($curl_handle, CURLOPT_URL, "$url");
 curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
 curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($curl_handle, CURLOPT_POST, 1);
 curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
 curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
 $buffer = curl_exec($curl_handle);
 curl_close($curl_handle);
?&gt;
</pre>
<p>If you&#8217;re looking for more info on how to use twitter, check out this <a href="http://80c59e-ex0t7s56uh6dma2cr3p.hop.clickbank.net/" target="_blank">eSeries</a>.  It&#8217;s a good resource.</p>
<p>So, have questions?  Let me know.  I&#8217;m hoping to do a twitter series soon!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li style="clear: both;"><a href="http://www.jtgraphic.net/code/june-2010-pr-checker-php-script/" rel="bookmark"><img src="http://www.jtgraphic.net/wp-content/plugins/contextual-related-posts/default.png" alt="June 2010 PR Checker PHP Script" title="June 2010 PR Checker PHP Script" width="50" height="50" border="0" class="crp_thumb" /></a> <a href="http://www.jtgraphic.net/code/june-2010-pr-checker-php-script/" rel="bookmark" class="crp_title">June 2010 PR Checker PHP Script</a><span class="crp_excerpt"> &lt;?php
function StrToNum($Str, $Check, $Magic)
{
 $Int32Unit = 4294967296;  // 2^32
 
 $length = strlen($Str);
 for ($i = 0; $i &lt; $length; ...</span></li><li style="clear: both;"><a href="http://www.jtgraphic.net/2008/12/january-2009-contest-twitterlicious/" rel="bookmark"><img width="50" height="30" src="http://www.jtgraphic.net/wp-content/twitter-bird-pic-300x180.jpg" class="crp_thumb wp-post-image" alt="January 2009 Contest: Twitterlicious" title="January 2009 Contest: Twitterlicious" border="0" /></a> <a href="http://www.jtgraphic.net/2008/12/january-2009-contest-twitterlicious/" rel="bookmark" class="crp_title">January 2009 Contest: Twitterlicious</a><span class="crp_excerpt"> Description
Every month, I do a contest of sorts for free shirts from shirt.woot.  This month I want to focus on ...</span></li><li style="clear: both;"><a href="http://www.jtgraphic.net/2010/01/bill-gates-twitter/" rel="bookmark"><img width="50" height="50" src="http://www.jtgraphic.net/wp-content/billgates_ss-150x150.jpg" class="crp_thumb wp-post-image" alt="Bill Gates is on Twitter" title="Bill Gates is on Twitter" border="0" /></a> <a href="http://www.jtgraphic.net/2010/01/bill-gates-twitter/" rel="bookmark" class="crp_title">Bill Gates is on Twitter</a><span class="crp_excerpt"> Oddly, I find it somewhat amusing that Bill Gates (@billgates) is getting into twitter so late in the game.  ...</span></li></ul></div><p><a href="http://www.jtgraphic.net/2010/02/twitter-api/">The Twitter API</a> is a post from: <a href="http://www.jtgraphic.net">jtGraphic: James Thompson</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API&amp;bodytext=I%27ve%20been%20messing%20with%20the%20Twitter%20API%20for%20the%20first%20time%20in%20the%20last%20few%20hours%2C%20and%20I%27ve%20learned%20a%20TON.%C2%A0%20I%20know%20-%20I%27m%20jumping%20on%20the%20bandwagon%20late%2C%20but%20oh%20well.%C2%A0%20I%20managed%20to%20create%20a%20script%20to%20retweet%20%22stuff%22%20based%20on%20the%20search%20functionality%20an" title="Digg"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API&amp;notes=I%27ve%20been%20messing%20with%20the%20Twitter%20API%20for%20the%20first%20time%20in%20the%20last%20few%20hours%2C%20and%20I%27ve%20learned%20a%20TON.%C2%A0%20I%20know%20-%20I%27m%20jumping%20on%20the%20bandwagon%20late%2C%20but%20oh%20well.%C2%A0%20I%20managed%20to%20create%20a%20script%20to%20retweet%20%22stuff%22%20based%20on%20the%20search%20functionality%20an" title="del.icio.us"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.jtgraphic.net/wp-content/plugins/sociable/awesmate.php?c=facebook-post&t=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&d=http://www.facebook.com/share.php?u=TARGET%26t=The%20Twitter%20API" title="Facebook"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API" title="Mixx"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API&amp;annotation=I%27ve%20been%20messing%20with%20the%20Twitter%20API%20for%20the%20first%20time%20in%20the%20last%20few%20hours%2C%20and%20I%27ve%20learned%20a%20TON.%C2%A0%20I%20know%20-%20I%27m%20jumping%20on%20the%20bandwagon%20late%2C%20but%20oh%20well.%C2%A0%20I%20managed%20to%20create%20a%20script%20to%20retweet%20%22stuff%22%20based%20on%20the%20search%20functionality%20an" title="Google Bookmarks"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API" title="StumbleUpon"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F" title="Technorati"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.jtgraphic.net/wp-content/plugins/sociable/awesmate.php?c=myspace&t=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&d=http://www.myspace.com/Modules/PostTo/Pages/?u=TARGET%26t=The%20Twitter%20API" title="MySpace"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.jtgraphic.net/wp-content/plugins/sociable/awesmate.php?c=twitter&t=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&d=http://twitter.com/home?status=The%20Twitter%20API%20-%20TARGET" title="Twitter"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F" title="Sphinn"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.jtgraphic.net%2F2010%2F02%2Ftwitter-api%2F&amp;title=The%20Twitter%20API" title="Reddit"><img src="http://www.jtgraphic.net/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.jtgraphic.net/2010/02/twitter-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
