
<?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.net &#187; curl_close</title>
	<atom:link href="http://jtgraphic.net/tag/curl_close/feed/" rel="self" type="application/rss+xml" />
	<link>http://jtgraphic.net</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 01:15:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>The Twitter API</title>
		<link>http://jtgraphic.net/twitter-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-api</link>
		<comments>http://jtgraphic.net/twitter-api/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:15:06 +0000</pubDate>
		<dc:creator>jt</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>Tweet 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 &#8230; <a href="http://jtgraphic.net/twitter-api/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>Originally posted on jtGraphic.net: <a href="http://jtgraphic.net/twitter-api/">The Twitter API</a></p>]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjtgraphic.net%2Ftwitter-api%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://jtgraphic.net/twitter-api/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jtgraphic.net/twitter-api/"  data-text="The Twitter API" data-count="horizontal" data-via="jtgraphic">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://jtgraphic.net/twitter-api/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://jtgraphic.net/twitter-api/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></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>&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 class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjtgraphic.net%2Ftwitter-api%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://jtgraphic.net/twitter-api/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jtgraphic.net/twitter-api/"  data-text="The Twitter API" data-count="horizontal" data-via="jtgraphic">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://jtgraphic.net/twitter-api/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://jtgraphic.net/twitter-api/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Originally posted on jtGraphic.net: <a href="http://jtgraphic.net/twitter-api/">The Twitter API</a></p>]]></content:encoded>
			<wfw:commentRss>http://jtgraphic.net/twitter-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

