Blogging and News Syndication Software

Blogger API, RSS API, Atom API, and more.
posts - 17, comments - 14, trackbacks - 26

My Links

News

Tortuga Components / Software Tools Home

See Also: Chilkat Software

Article Categories

Archives

Post Categories

Recommended

Technorati SearchQuery C# Sample Source Code


C# sample code using "Tortugati", a .NET class library for the Technorati API.
The Tortuga .NET Component (Beta) can be downloaded from Tortuga .NET Component
The download contains an .NET class library (DLL) that needs to be referenced from your C# or VB.NET project.


// Technorati SearchQuery C# Example Source Code
Tortuga.Technorati tech = new Tortuga.Technorati();
    
// An API key is required.  You can get the Technorati API Key
// from http://www.technorati.com/developers/
tech.Key = "e6123d11111192671bd110cf2a5e3b83";
    
// Find blogs about nanotechnology
// When using more than one search term, separate the terms
// with spaces. For example: "blog software"
Tortuga.Rss rss = tech.SearchQuery("nanotechnology");
if (rss == null) 
{
    // Display the error returned by Technorati.
    MessageBox.Show(tech.RawQueryResponse);
}
else
{
    // Success! Let's get some information...
    // The RSS response always has a single channel.  The information will 
    // be contained within the channel.
    Tortuga.Rss channel = rss.GetChannel(0);
				
    // Iterate over the search results:
    int i;
    for (i=0; i<channel.NumItems; i++)
    {
	Tortuga.Rss item = channel.GetItem(i);
	    
	string blogTitle = item.GetString("title");
	string blogUrl = item.GetString("link");
	    
	listBox1.Items.Add(blogTitle);
	listBox1.Items.Add(blogUrl);
	listBox1.Items.Add("----");

	// There are many other field you could retrieve for each search result:
	string description = item.GetString("description");
	DateTime created = item.GetDate("tapi:created");
	int numInboundBlogs = item.GetInt("tapi:inboundblogs");
	int numInboundLinks = item.GetInt("tapi:inboundlinks");
	string atomUrl = item.GetString("tapi:atomurl");
	string rssUrl = item.GetString("tapi:rssurl");
    }
	
    // The RSS response is also available in the RawQueryResponse property.
    // Be sure to have a look at the response so you can see what other information
    // might be available.  
    textBox1.Text = tech.RawQueryResponse;
}

Print | posted on Thursday, September 29, 2005 10:15 AM |

Feedback

Gravatar

# re: Technorati SearchQuery C# Sample Source Code

Hello!
I just test Tortuga .NET Technorati API. It is very useful for me.
I'd like to get Technorati Tags using this API. But how can I do?
I have found java code. I don't know it doesn't work my code.
So I want to implement this with Tortuga .NET Technorati API.
Do you have any sample code or helpful guide?
Thanks,

Ryan
4/4/2006 7:03 AM | Ryan
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: