<?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>C#, VB.Net, XML and mass consumption of coffee. &#187; twitter</title>
	<atom:link href="http://www.paul-zubkov.com/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paul-zubkov.com</link>
	<description></description>
	<lastBuildDate>Wed, 03 Feb 2010 18:25:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Twitter API with C# example(part 2)</title>
		<link>http://www.paul-zubkov.com/2009/08/02/twitter-api-with-c-examplepart-2/</link>
		<comments>http://www.paul-zubkov.com/2009/08/02/twitter-api-with-c-examplepart-2/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 07:11:23 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitter API C#]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.paul-zubkov.com/?p=249</guid>
		<description><![CDATA[
First of all, I have to admit that I decided to take a vacation.  Vacation from everything &#8211; work, freelance, projects, blog, etc.  It&#8217;s summer and despite the crappy weather here in Toronto, I am spending time with my family which actually rocks.  Now vacation is over, let&#8217;s get back to coding [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-254" title="sundial" src="http://www.paul-zubkov.com/wp-content/uploads/2009/08/sundial.jpg" alt="sundial" width="300" height="225" /></p>
<p>First of all, I have to admit that I decided to take a vacation.  Vacation from everything &#8211; work, freelance, projects, blog, etc.  It&#8217;s summer and despite the crappy weather here in Toronto, I am spending time with my family which actually rocks.  Now vacation is over, let&#8217;s get back to coding &#8211; today I wanted to continue with Twitter examples.  Twitter seems to be very hot, and I was curious as to how to get the most out of it from the coding perspective.    Here is a tiny function that gets the followers of a user, providing we know the username and password:</p>
<p><code lang="csharp[lines]">public string FetchFollowers(string userName, string password)<br />
{<br />
    using (var client = new WebClient())<br />
    {<br />
        client.Credentials = new NetworkCredential(userName, password);<br />
        try<br />
        {<br />
            using (var stream = client.OpenRead("http://twitter.com/statuses/followers.xml"))<br />
            {<br />
                using (var reader = new StreamReader(stream))<br />
                {<br />
                    return reader.ReadToEnd();<br />
                }<br />
            }<br />
        }<br />
        catch (WebException ex)<br />
        {<br />
            //insert code to deal with exception HERE<br />
        }<br />
    }<br />
    return string.Empty;<br />
}</code></p>
<p>There are two types of &#8220;connection&#8221; between the people on twitter &#8211; followers and friends &#8211; I am too lazy to look up the difference between the two, but if you want list of friends then line 8 in the function above should look like this:</p>
<p><code lang="csharp[lines]">using (var stream = client.OpenRead("http://twitter.com/statuses/friends.xml"));</code></p>
<p>I usually stuff the output of that in XML and then do what I need to do with it.</p>
<p>Let me take a break for now, next time we will cover posting to Twitter (status update).</p>
<p>BTW, first part of this could be found <a href="http://www.paul-zubkov.com/2009/07/01/twitter-api-with-c-examplepart-1/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paul-zubkov.com/2009/08/02/twitter-api-with-c-examplepart-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter API with C# example(part 1)</title>
		<link>http://www.paul-zubkov.com/2009/07/01/twitter-api-with-c-examplepart-1/</link>
		<comments>http://www.paul-zubkov.com/2009/07/01/twitter-api-with-c-examplepart-1/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 02:21:48 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitter API C#]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.paul-zubkov.com/?p=220</guid>
		<description><![CDATA[
Currently I am involved in a project where number of things have to be done using Twitter API.  What really amazes me today is the quality of API&#8217;s available to developers.  Twitter is a perfect example of such API.  I will try to publish some code that I used to accomplish several [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.paul-zubkov.com/wp-content/uploads/2009/07/sunflower.jpg" alt="sunflower" title="sunflower" width="299" height="200" class="alignnone size-full wp-image-229" /></p>
<p>Currently I am involved in a project where number of things have to be done using Twitter API.  What really amazes me today is the quality of API&#8217;s available to developers.  Twitter is a perfect example of such API.  I will try to publish some code that I used to accomplish several tasks starting with getting the details of a Twitter user providing you are aware of the user password and username.</p>
<p>Following code will retrieve a variety of information about a Twitter account:<br />
<code lang="csharp"><br />
public string FetchUserDetailsAsXml(string userName, string password, string IDorScreenName)<br />
{</p>
<p>        if(string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password))<br />
        {<br />
            throw new ArgumentException("userName or Password are not supplied, that is not good.");<br />
        }</p>
<p>    string url = string.Format(TwitterBaseUrlFormat, "users", "show" + "/" + IDorScreenName, "xml");</p>
<p>    using (var client = new WebClient())<br />
    {<br />
        client.Credentials = new NetworkCredential(userName, password);</p>
<p>        try<br />
        {<br />
            using (var stream = client.OpenRead(url))<br />
            {<br />
                using (var reader = new StreamReader(stream))<br />
                {<br />
                    return reader.ReadToEnd();<br />
                }<br />
            }<br />
        }<br />
        catch (WebException weex)<br />
        {<br />
            if (weex.Response is HttpWebResponse)<br />
            {<br />
                if ((weex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotFound)<br />
                {<br />
                    return null;<br />
                }<br />
            }<br />
            throw;<br />
        }<br />
    }</p>
<p> }<br />
</code></p>
<p>That&#8217;s pretty much it.  Need System.Net and System.Web for this, obviously.  What you get out of that looks like this:</p>
<p><code lang="xml"></p>
<p>- <user><br />
  <id>14381487</id><br />
  <name>pzubkov</name><br />
  <screen_name>pzubkov</screen_name><br />
  <location>Ontario, Canada</location><br />
  <description>Coder, mostly .net</description></p>
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/56116140/Me_normal.jpg</profile_image_url>
  <url>http://www.paul-zubkov.com</url></p>
<protected>false</protected>
  <followers_count>39</followers_count></p>
<profile_background_color>709397</profile_background_color>
<profile_text_color>333333</profile_text_color>
<profile_link_color>FF3300</profile_link_color>
<profile_sidebar_fill_color>A0C5C7</profile_sidebar_fill_color>
<profile_sidebar_border_color>86A4A6</profile_sidebar_border_color>
  <friends_count>61</friends_count><br />
  <created_at>Mon Apr 14 05:08:22 +0000 2008</created_at><br />
  <favourites_count>0</favourites_count><br />
  <utc_offset>-18000</utc_offset><br />
  <time_zone>Eastern Time (US  Canada)</time_zone></p>
<profile_background_image_url>http://static.twitter.com/images/themes/theme6/bg.gif</profile_background_image_url>
<profile_background_tile>false</profile_background_tile>
  <statuses_count>49</statuses_count><br />
  <notifications>false</notifications><br />
  <verified>false</verified><br />
  <following>false</following><br />
- <status><br />
  <created_at>Wed Jul 01 19:15:11 +0000 2009</created_at><br />
  <id>2424620582</id><br />
  <text>twitter api rocks, this is sweet</text><br />
  <source></source>web</p>
<truncated>false</truncated>
  <in_reply_to_status_id><br />
  <in_reply_to_user_id><br />
  <favorited>false</favorited><br />
  <in_reply_to_screen_name><br />
  </in_reply_to_screen_name><br />
  </in_reply_to_user_id><br />
</in_reply_to_status_id></status></user></code></p>
<p>As we can see from above, I am not an avid Twitter user myself, but I find that the API produced by Twitter is extremely well done.  In Part 2 and 3 I will cover sending new update and getting followers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paul-zubkov.com/2009/07/01/twitter-api-with-c-examplepart-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweet Street: 7 Extraordinary (read: rediculous) Twitter Uses in the Home</title>
		<link>http://www.paul-zubkov.com/2009/05/13/tweet-street-7-extraordinary-read-rediculous-twitter-uses-in-the-home/</link>
		<comments>http://www.paul-zubkov.com/2009/05/13/tweet-street-7-extraordinary-read-rediculous-twitter-uses-in-the-home/#comments</comments>
		<pubDate>Wed, 13 May 2009 20:14:42 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://www.paul-zubkov.com/?p=181</guid>
		<description><![CDATA[Tweet, tweet, tweeeeeeet just keep the 140 char limit in mind.  Looks like everyone and their grandma has drank the kool-aid on this twitter trend.  I know this is supposed to be cool and useful, and at times it is, but this article is a prime example of why twitter is complete waste [...]]]></description>
			<content:encoded><![CDATA[<p>Tweet, tweet, tweeeeeeet just keep the 140 char limit in mind.  Looks like everyone and their grandma has drank the kool-aid on this twitter trend.  I know this is supposed to be cool and useful, and at times it is, but <a href="http://mashable.com/2009/05/12/twitter-at-home/" target="_blank">this article</a> is a prime example of why twitter is complete waste of time and effort for the most parts. <a href="http://mashable.com/author/jennifer-van-grove/" target="_blank"> Jennifer Von Grove</a> goes on to explore some extraordinary examples of how to use twitter, honestly the use of the word &#8220;extraordinary&#8221; in this article is as appropriate as describing a process of passing a kidney stone using the same term.  Let&#8217;s look at those, shall we?<span id="more-181"></span></p>
<p><strong>1.  Pets all-a-Twitter</strong></p>
<p>So apparently our lives are so empty and decimated that we want to know of the latest hairball produced by someone else s cat.  After all, its not like there are things happening in the world, right? <a href="http://twitter.com/sockington" target="_blank"> Sockington the Cat</a> with its 480000 followers &#8211; give me a break.  No sane or reasonable person would be interested in an entry such as:</p>
<p>&#8220;<em>chuf chuf chuf chuf chuf chuf chuf chuf chuf chuf chuf chuf chuf chuf CHUF CHUF CHUF CHUF CHUF CHUF CHUF COME ON STAY DOWN THERE</em>&#8221;</p>
<p>I know we all love pets, they are adorable, cute and &#8220;think they are people&#8221; and such, but the cat itself could not possibly care less about what its master is posting on its behalf.  What really gets me is that there are 480000 people out there who consider this to be interesting.  It is almost as sad as the fact that I am writing about it now instead of doing something productive.</p>
<p><strong>2.</strong>  <strong>Wiser Washer</strong></p>
<p>Is my laundry done yet? How about now? Now?  Maybe Now?  This time it is definitely done, right?  How about now?  This reminds me of a lengthy car trip with my kids and that eternal &#8220;Are we there yet?&#8221;  Here is a radical idea &#8211; observe the washing machine: does it make sounds? Does it shake violently?  Is a sound of rushing water present?  Is the handle pointing to a position different from the one marked &#8220;Off&#8221;?  If you answered &#8220;no&#8221; to all 4 &#8211; your laundry is done.  Better yet, a normal cycle on my washing machine takes about 45 minutes.  There is this device called &#8220;clock&#8221; &#8211; it measures time.  Really convenient when doing laundry.</p>
<p><strong>3.  Communicating with plants.</strong></p>
<p>Here is a new thing, I guess the target market are those who bought &#8220;Pet Rock&#8221;.  The idea is &#8211; give me $100.00 less a penny plus shipping and your plants would be able to annoy you with requests for water and other things.  I am not at home, so it is difficult for me to estimate this, but I have total of probably 14 plants at home, including the one my kid brought home from school for Mother&#8217;s Day.  Let me promptly send $1400.00 of my hard earned currency units just so a freaking geranium situated on the window at my living room would boss me around.  Sounds just like a marvelous idea.  NOT.</p>
<p><strong>4.  Monitor Power Usage</strong></p>
<p>I am quoting the author on this one &#8211; &#8220;<em>If communicating with your plants via Twitter sounds cool, then you should be turned on, or more appropriately, turned off, by the idea of tracking power usage in every room of your home via Twitter.</em>&#8221;  So in essence, you got your Pet Rock, you got the plants barking orders at you like the nazi from WWII movie, now you are not quite done yet, get the new best thing &#8211; monitor your power usage.  Look, I am all about saving the environment, I recycle, I don&#8217;t waste energy and so on, but what possible use would the information about my power consumption be?   Look at the laundry example &#8211; walk into the room, turn off the lights and other electrical devices when not in use.  There, I just saved you bunch of cash, cause guess what &#8211; the hardware to monitor your power usage costs money.</p>
<p><strong>5.  Fresh from the oven Twittering.</strong></p>
<p><em><strong>Zapp Brannigan</strong>: Kif, I have made it with a woman. Inform the men</em>.  I don&#8217;t know about you, and I love coffee and all, but if my local coffee house would inform me when there is a fresh pot ready, I would be annoyed.  Same goes for pastry, sweet, fresh delicious pastry.  Come on, not everything in life should be digitized, modernized and optimized.  What fun is it to go to your local coffee shop and ask the staff if their pastries are fresh or not.  It can be made into a game of sorts.  Imagine if this trend will actually take off, what kind of line ups would you face.  And I don&#8217;t care for baked goods, all I want is my pure java.  Am I alone on thinking that this can be abused beyond our wildest dreams?</p>
<p><strong>6.  Tooting and Twitting.</strong></p>
<p>Wow, now this is the use of technology that is going to revolutionize our lives.  And yes, this means exactly what the title implies.   Here is the quote from<a href="http://www.randysarafan.com" target="_blank"> Randy Sarafan</a>, the inventor of such helpful service “<em>the first part of life that needed to be documented was my daily flatulence at work. I am not going to lie, I am a gassy individual. Since my flatulence is a part of life, it would be fraudulent of me to document life as it happens without documenting these occurrences</em>.”  I can&#8217;t comment on this.</p>
<p><strong>7.  Baby Movements</strong></p>
<p>I am a father myself, when my wife was pregnant every movement of the child was like a little miracle, but if I would have suggested to strap a vibration sensing equipment onto my wife&#8217;s belly, I would probably end up sleeping on a couch for a while.  Have anyone considered what baby wants?  Does he or she feels the same way about sharing those first life experiences with total strangers?  Come on, this is a waste of time, effort and money.</p>
<p>Bottom line is life is great.  Technology is great as well, but at times there is too much technology in our lives.  I can manage my laundry and my plants without  a high tech gizmo telling me what to do.  I don&#8217;t need to follow people&#8217;s pets and document gas.  It is pointless, just like the fact that the time I wasted writing this post could be better spent doing something creative.  I became a software developer because I am the one who tells machines what to do, I am the boss, not a piece of the hardware that measures content of water in the plant soil and orders me to act.</p>
<p>I am not saying that I avoid twitter, I do use it daily but not to learn about some one else&#8217;s gas, I get links to some great articles that people who are much smarter then I write about subjects that interest me.  I don&#8217;t promote my posts using twitter or any other sources, no need, I mostly write for myself anyways.  The saddest part of this whole story is that I found this article via Twitter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paul-zubkov.com/2009/05/13/tweet-street-7-extraordinary-read-rediculous-twitter-uses-in-the-home/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
