Thursday, May 28, 2009

Retrieving information from RSS in .NET

In my earlier post I discussed on the overview of the RSS (Really Simple Syndication) Feeds and how it can be used by any user as a source of information. Today am going to talk about how as a developer you can utilize these RSS for fetching certain information for your application. Yes you can retrieve and use the information provided by these RSS feeds, depending upon what information is provide in the RSS.

Before starting to use RSS to retrieve information, let’s have a high level look on the RSS format. RSS is defined as a XML based Data structure, as shown in a sample below:

<rss version="2.0">
<channel>
<title>Composed Crap</title>
<link>http://composedcrap.blogspot.com</link>
<description></description>
<item>
<RSS for .NET Developers</title>
<link> http://composedcrap.blogspot.com/2009/05/rss-for-.Net-developers.html </link>
<description>... content of the RSS feed... </description>
</item>
</channel>
</rss>


For more details on the RSS structure, just google for it and I am sure you will find more detailed description.

So you know this information provided by the RSS since is in XML format, can be parsed easily to fetch the required details. Well, you don’t have to take the pain of parsing. Just download the ASP.NET RSS Toolkit from http://www.codeplex.com/ASPNETRSSToolkit and you are ready to go.

Once you download the Toolkit, add reference to the RSSToolkit API you just downloaded in you .NET Project where you want to retrieve the information from the feed.

Here is the code for retrieving the feed items from a particular feed site, I am using ComposeCrap RSS here as an example:

//Retrieve the RSS from the site and load it into the RssDocument
RssToolkit.Rss.RssDocument rss = RssToolkit.Rss.RssDocument.Load(new System.Uri("http://composedcrap.blogspot.com/feeds/posts/default"));
//For each Item in the RSS retrieve the description and wite it on the console
foreach (RssItem item in rss.Channel.Items)
{
Console.WriteLine(item.Description);
}


Now there are many RSS providers that do not provide the complete description of the feeds. In that case if you want to retrieve the complete description of an item, check for the tag
<content:encoded> in the XML source of the feed. You can see the XML source of the feed through page source of the feed web page. This is because some sites do not provide the complete information in the description of the feed but however they want to publish the complete information through the feed that can be used by others (not reader).

Note: If a site does not provide the complete description of the feed items, it is not necessary that the content will be available <content:encoded> through tag. If the RSS site does not provide the complete information by either way you cannot retrieve the complete details using just the RSS toolkit.

To retrieve the information from the <content:encoded> tag, you first need to add the Encode information to the RSS Toolkit.

  1. Open the RssToolkit solution from the Source folder of the downloaded toolkit.
  2. Open the RssItem.cs file and add the following property:
    private string _encode;
    [XmlElement("encoded",Namespace = "http://purl.org/rss/1.0/modules/content/")]
    public string Encode
    {
    get
    {
    return _encode;
    }
    set
    {
    _encode = value;
    }
    }
  3. Build the RssToolkit project and update the reference in you .NET project which is referencing the RssToolkit API.
  4. After updating the reference, in the RssItem object, you will be able to access the property Encode, which provides the complete description of the item.
    RssToolkit.Rss.RssDocument rss = RssToolkit.Rss.RssDocument.Load(new System.Uri("http://www.bollywoodz.net/feed/"));
    foreach (RssItem item in rss.Channel.Items)
    {
    Console.WriteLine(item.Encode);
    }
If you are looking to use information from any RSS in your .NET application, go ahead and start using RSSToolkit for .NET following the details above.

Sunday, May 17, 2009

RSS (Really Simple Syndication) Overview

Everyone here wants to be updated; updated with the information, updated with what’s going on, updated in their subject of interest, updated with where the world is heading towards; as it’s the key thing for your decision on your future actions. But the question is from where do you bring in all these data to be always updated? Quick answer on your mind “INTERNET”, an invaluable source of Information with anything and everything you want. Agreed! But here is the challenge with digging information in the Ocean of Internet.

As a traditional user of Internet, Lets say I log into 10 sites, and of which may be 3 sites give me the information that I was really seeking for. Thus, the time I spent visiting the other sites and searching for the content was just in vain. We as Users,

  • Can’t Always spend hours searching
  • Don’t have time to visit number of sites to read the good info
  • Email is Overwhelming
  • Can’t remember to visit all sites religiously daily.
Here comes the role of RSS, the information that arrives to you, rather than you going to seek for them.

With RSS you can subscribe to the contents of various websites at a single place, the “Reader”. The content you subscribe to is called a “Feed”. Any updates occurring to any of your feeds will be updated to your Reader as soon as the changes occur.

To subscribe to any site you need to first go and sign up with any of the Reader Sites like, www.google.com/reader, www.bloglines.com, www.newsgator.com, http://my.yahoo.com/, and there are many more in the list.

After you signup, to subscribe to any of the site that you want to get updates from, click on Add Subscription or Add Content link as shown below:

A sample of my Google Reader looks like:

where on the left hand side is my list of subscriptions while the right hand side shows the updates from the selected subscription sites.

Every time after you read a particular item from the feed, the item is marked as Read by the Reader, as it happens on your e-mail. Isn’t it so convenient when you know the items that you have already read and not search more into it?

Not only can you subscribe to a particular news site, or blog. You can subscribe even to a particular topic about which the information is scattered at multiple places on the internet. To do that Yahoo Pipes can be the most useful tool for you. Follow the following steps to get a subscription for a particular topic:
  • Open the Social Media Firehose pipe on yahoo pipes http://pipes.yahoo.com/pipes/pipe.info?_id=f1ae63990f6d5b9e48ce807a77bb9995
  • In Search for comma separated terms type in the topic you want to search for with “Quotes”
  • You can filter the result on the basis of location and can even block any particular URL if you want to
  • After you provide the valid parameters, click on Run Pipe and it will bring you the result for the topic from all the possible locations on the internet
  • Once you have the result from the Social Media Firehose, click on Get as RSS on top of the result. It will take some time to generate the RSS, say a couple of minutes, so be patient. You don’t have to do that always :)
  • The above step will launch a page with the URL of the following format: http://pipes.yahoo.com/pipes/pipe.run?_id=f1ae63990f6d5b9e48ce807a77bb9995&_render=rss&terms=%22RSS+Feeds%22
  • Copy the URL and Subscribe to it on your Reader. The subscription to the specified URL will bring you any updates on the topic you searched for on your Reader.
So subscribe to your favorite Sites and Topics and Enjoy reading.

Thursday, May 7, 2009

should I charge for my iPhone app or Run Ads?


Research Brief just released a report giving some insights on Mobile App market (especially iPhone):

• 24% of Smartphone users have spent anywhere from $10-$50 for a single application,
• 28% have spent between $5-10 on a single app.
• 86% of iPhone owners have paid at most $.99 - $9.99 on a single app
• 83% of these iPhone owners have downloaded at least six

The question for most app developers and marketers is always run into is to make the App free or charge for it? Bottom line developers are seeking higher ROI.

Let’s look how consumers think. Most of the consumers love stuff for free or for cheap. They don’t give a crap about developers, effort and money. However, a recent claim from PitchEngine claims that $5 is not too much for a smart App download. Note the word *not too much*- i.e. only 28% of Smart phone users.

Now let’s explore other option. Have the app for free and earn from advertisement? Basically you are hoping that users will love your content and interact often with app. But most of iPhone users get bored or stop using as frequently in a short while, so now developers are struggling to get pageviews for their app.

At the end it comes down if your app usage going to be high? Does your app has a social and viral effect? Does your apps sends out alerts to users with information which is personal customized to their taste? If yes then I would choose to make the app free or really cheap So that you can keep earning on ad impressions and clicks.

Well if the app is cool and interesting I would choose to charge for the App between $0.99 to $3.99. Assuming that the app has great UI, a good information user is looking access and fun for bit so that users don’t think they got ripped off. I would strongly recommend having Analytics on your app, to better understand your user behavior to make your app stickier.


I am not sure if this holds the same for AppWorld, OviStore and WebOS. Since other mobile platform is just does not make me to browse through the virtual store to shop for Applications (hope OviStore and WebOS would be better than AppWorld when they are out). Well iPhone atleast just makes me to check the virtual Store to check what’s new and cool. Android G1 once while makes me to go check out some apps, not as much as iphone.

Note: This blog post is target to individual developers who has full time or in school and building apps on side. Not for professionals or cooperates.
FYI – I use a BlackBerry, G1, Nokia and the iPhone.

Find me on Twitter @VishalChordia

Monday, May 4, 2009

Wish of list of a web2.0 marketer?

Recently Forrester Research just estimated that social media marketing spend is expected to grow from $455M in 2008 to $3.1B in 2014. There are over 450 million users when you combine the users of major social networking sites -Facebook, MySpace, Twitter, Orkut and Hi5. With such extraordinary growth opportunity in social media there are some new unique challenges for marketers with content promotion and measurement.

In today’s web2.0 world the goal of every marketer is their content to have it own legs and spread as far as possible across social media channels. With that come the challenges of measuring the impact and effectiveness of their campaigns.

Marketers are wondering what if I could segment my social media viewer/users by age, gender, network, school, number of friends they have, and the city they live to understand how they interact with my content and what kind of action is triggered in each of the segments. What if I could get some insights to the path or events which led viewers/users to conversion or acquisition? Wouldn’t it be great if I could correlate my social media metrics with my conversion and acquisition events with other online channel such as Web, Mobile, Video, etc. to get a complete 360 view? Wouldn’t it be great if I could measure all my social media channels asily without any additional complexity?

Well stay tuned to my blog post in coming weeks to know learn about the solution which will help you answer all above questions.

-Vishal