<?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>Sean&#039;s Blog &#187; curl</title>
	<atom:link href="http://seanbehan.com/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Uploading Files with Curl</title>
		<link>http://seanbehan.com/linux/uploading-files-with-curl/</link>
		<comments>http://seanbehan.com/linux/uploading-files-with-curl/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 16:10:05 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips & snippets]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1174</guid>
		<description><![CDATA[curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload Courtesy of http://ariejan.net/2010/06/07/uploading-files-with-curl/]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fuploading-files-with-curl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Uploading Files with Curl" data-url="http://seanbehan.com/linux/uploading-files-with-curl/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><pre class="wp-code-highlight prettyprint">
curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload
</pre>
<p>Courtesy of <a href="http://ariejan.net/2010/06/07/uploading-files-with-curl/">http://ariejan.net/2010/06/07/uploading-files-with-curl/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/uploading-files-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grab a Twitter Status without the Twitter API</title>
		<link>http://seanbehan.com/php/grab-a-twitter-status-without-the-twitter-api/</link>
		<comments>http://seanbehan.com/php/grab-a-twitter-status-without-the-twitter-api/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 01:53:43 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=703</guid>
		<description><![CDATA[Quick and dirty way to grab the users status messages without having to go through the twitter api (not having to authenticate that is). You can grab the RSS feed and indicate the number of statuses returned with the count param. I wrote this function for my blog in PHP. It uses the curl extension [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fphp%2Fgrab-a-twitter-status-without-the-twitter-api%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Grab a Twitter Status without the Twitter API" data-url="http://seanbehan.com/php/grab-a-twitter-status-without-the-twitter-api/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Quick and dirty way to grab the users status messages without having to go through the twitter api (not having to authenticate that is). You can grab the RSS feed and indicate the number of statuses returned with the count param. I wrote this function for my blog  in PHP. It uses the curl extension so if it&#8217;s not installed type</p>
<pre class="wp-code-highlight prettyprint">
apt-get install php5-curl
</pre>
<p>Otherwise you&#8217;ll have to use the fsockopen function. Then it&#8217;s just a matter of parsing the XML and getting at what data you want. I just want one status so I&#8217;m accessing the element directly, rather than looping over the returned data set.</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;php
function latest_twitter_status_message(){
        // grab the rss feed link from some user, like me and indicate the count in the url
	$host = &quot;http://twitter.com/statuses/user_timeline/11036982.rss?count=1&quot;;
	// using curl
	$ch = curl_init($host);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	$data = curl_exec($ch);
	curl_close($ch);
	$doc = new SimpleXmlElement($data, LIBXML_NOCDATA);
	return &quot;{$doc-&gt;channel-&gt;item[0]-&gt;description}&quot;;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/php/grab-a-twitter-status-without-the-twitter-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating Your Twitter Status with cURL and a Bash Function</title>
		<link>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/</link>
		<comments>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 01:34:50 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=673</guid>
		<description><![CDATA[I&#8217;m usually at the command line so I wrote a little a bash function so that i can type tweet this is really neat but kind of pointless and it will update my twitter status! some characters trip it up but in general it&#8217;s useful for most of my tweets. The tweet function just spits [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fupdating-your-twitter-status-with-curl-and-a-bash-function%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Updating Your Twitter Status with cURL and a Bash Function" data-url="http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I&#8217;m usually at the command line so I wrote a little a bash function so that i can type</p>
<pre class="wp-code-highlight prettyprint">
tweet this is really neat but kind of pointless
</pre>
<p>and it will update my twitter status! some characters trip it up but in general it&#8217;s useful for most of my tweets. The tweet function just spits out the arguments passed to it for the status parameter for the API call to twitter.</p>
<p>Add the following to the .bash_profile file and reload the terminal (don&#8217;t forget to add your email and pwd where appropriate).</p>
<pre class="wp-code-highlight prettyprint">
tweet() {
   curl -u your_twitter_email_addr:your_twitter_passwd -d status=&quot;$*&quot; http://twitter.com/statuses/update.xml
 }
 </pre>
<p>*** Twitter still uses http basic authentication for their API. However, they are moving away from it in favor of oAuth. So I&#8217;m not sure how long this fun will last :{</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

