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

Ask A Question

Stats

  • Questions 166k
  • Answers 166k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Skip and Take aren't the problem here - they will… May 12, 2026 at 1:15 pm
  • Editorial Team
    Editorial Team added an answer I am not sure I follow you completely, but perhaps… May 12, 2026 at 1:15 pm
  • Editorial Team
    Editorial Team added an answer yes you have to erase the leading 0 on your… May 12, 2026 at 1:15 pm

Related Questions

I am working on a small intranet site for a small company, where user
I am working on a small application in VB.NET. The program needs administrator privilege
I am working on a small team of web application developers. We edit JSPs
I am working on a small AIR desktop application and I have some configuration

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.