Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 106171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:33:17+00:00 2026-05-11T01:33:17+00:00

I am working on a small widget for BlogEngine.Net. My widget is going to

  • 0

I am working on a small widget for BlogEngine.Net. My widget is going to take a person’s shared items atom feed and print the title, website url, date, and atom url. To complete this task, I have begun to use Linq and XML.

Here is the problem. The atom feed Google Reader uses is located in the source element, which has an attribute of gr:stream-id. Apparently, the XName does not like having colons in the name. I had to go that route because the Google Reader schema does not exist. If I had that schema, it would solve my issue. How can I get the schema?

Below is a small snippet of my code so far:

protected void Page_Load(object sender, EventArgs e) {     //Replace userid with the unique session id in your Google Reader      //url (the numbers after the F)     getFeed('userid'); }  public class Post {     public String title { get; set; }     public DateTime published { get; set; }     public String postUrl { get; set; }     public String baseUrl { get; set; }     public String atomUrl { get; set; } }  private void getFeed(String userID) {     String uri = 'http://www.google.com/reader/public/atom/user%2F' + userID + '%2Fstate%2Fcom.google%2Fbroadcast';      XNamespace atomNS = 'http://www.w3.org/2005/Atom';     //The Google Reader schema link does not exist :(     XNamespace grNS = 'http://www.google.com/schemas/reader/atom/';     XDocument feed = XDocument.Load(uri);      var posts = from item in feed.Descendants(atomNS + 'entry')                 select new Post {                     title = item.Element(atomNS + 'title').Value,                     published = DateTime.Parse(item.Element(atomNS + 'published').Value),                     postUrl = item.Element(atomNS + 'link').Attribute('href').Value,                     atomUrl = item.Element(atomNS + 'source').Attribute(grNS + 'href').Value                 };     foreach (Post post in posts) {         output.InnerHtml += 'Title: ' + post.title + '<br />';         output.InnerHtml += 'Published: ' + post.published.ToString() + '<br />';         output.InnerHtml += 'Post URL: ' + post.postUrl + '<br />';         output.InnerHtml += 'Atom URL: ' + post.atomUrl + '<br />';         output.InnerHtml += '<br />';     } } 

If there is another way to go about this while still using Linq and XML, please let me know. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:33:17+00:00Added an answer on May 11, 2026 at 1:33 am

    I did find an alternative solution to getting the atom feed url. However, I would still prefer to use the Google Reader Atom Schema because that would provide a bit clear code.

    In the atom feed, there is an id element, which looks like this:

    tag:google.com,2005:reader/feed/http://www.domain.com/blog/rss.xml 

    So I added the following to my Linq code:

    atomUrl = getUrl(item.Element(atomNS + 'source').Element(atomNS + 'id').Value) 

    With getUrl looking like this:

    private String getUrl(String item) {     if (!item.Equals('')) {         return item.Substring(item.IndexOf('http://'));     }     return ''; } 

    That code return http://www.domain.com/blog/rss.xml

    This solution seems to run around the use of namespaces, but it gets the job done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the dojo tree widget working. It works with a small
Currently I am working on small application in asp.net mvc. It is a some
Working on a small program that will take a string from a user and
I'am working on small ASP.NET MVC project and I got an weird behaviour. At
I have a small working application in ASP.NET and C#, and I would like
Iam working on small booking room system. In my solution I have a Reservation
is there any small working program for recieving from and sending data to client
I am working on small python payroll project where you enter employee name, wage,
I've been quite used to working on small projects which I coded with 1,000
I'm a LAMP guy and ended up working this small news module for an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.