Shiny objects for MSDN and TechNet Social: #2 Custom feed queries - Chris.blog.Microsoft - Site Home - MSDN Blogs

Shiny objects for MSDN and TechNet Social: #2 Custom feed queries

Shiny objects for MSDN and TechNet Social: #2 Custom feed queries

  • Comments 6

Continuing our series of cool new stuff you can do with our new social platform, Taylor Parsons has a post fully outlining all the conditions and parameters that you can use to slice and dice social platform queries.

Here's some examples using Taylor's instructions, broken down so that you can see how to construct them:

Today's forum threads tagged "WPF"

http://services.social.microsoft.com/feeds/feed/query/tag/wpf/eq/
ns/ForumThreads/eq/and/nsrecursion/true/eq/and/timespan/P1D/eq/and

OK, let's break this down:

  • http://services.social.microsoft.com/feeds/feed/query/ - this is the root of all feed queries.
  • tag/wpf/eq/ - This requests anything with a tag equal (eq) to "wpf"
  • ns/ForumThreads/eq/ - This specifies that results should be limited to the "forumthreads" namespace (only items of type "forum thread" will be returned).
  • and/ - Now that we have more than one qualifier, we need to start adding our operators (and / or).
  • nsrecursion/true/eq/ - Use this whenever you request forum threads because the forum namespace is hierarchical. If you leave this out, you won't get any results because it will only pull from the root namespace, which is empty.
  • and/ - Remember an operator after each condition.
  • timespan/P1D/eq/ - This specifies a time span of 1 day. This is why you won't see many results in this feed. But it might be a great mini-feed to have on your blog if you're a WPF guru...
  • and - the last operator.

Note that our system stacks all the operators (and's) at the end. Either way works, but I personally think it's less confusing this way.

50 most popular German MSDN bookmarks in the past month

http://services.social.microsoft.com/feeds/feed/query/locale/de-de/eq/ns/SocialBookmarking/eq/and/timespan/P30D/eq/
and/brand/msdn/eq/and/?sort=popularity&count=50

The breakdown:

  • http://services.social.microsoft.com/feeds/feed/query/ - the root.
  • locale/de-de/eq/ - Limits the results to those items saved from the German versions of the applications.
  • ns/SocialBookmarking/eq/and/timespan/P30D/eq/and/ - Note we're now refining to the SocialBookmarking namespace instead of forums. Also, the timespan is greater.
  • brand/msdn/eq/and - Here's how you limit to one of our four brands (msdn, technet, expression, or microsoft).
  • ?sort=popularity - This is a parameter noting the sort order. Default = recency.
  • &count=50 - Limits the results to the top 50.

The most popular items ever saved to TechNet on "Virtualization, Hyper-V and deployment"

http://services.social.microsoft.com/feeds/feed/?query=brand/Technet/eq/nsrecursion/True/eq/and/ns/SocialBookmarking/eq/
and/ns/ForumThreads/eq/and/tag/virtualization/eq/and/tag/hyper-v/eq/and/tag/deployment/eq/and&sort=Popularity

The breakdown:

  • http://services.social.microsoft.com/feeds/feed/query/ - the root.
  • brand/technet/eq/ - scoped to TechNet.
  • nsrecursion/True/eq/and/ns/SocialBookmarking/eq/
    and/ns/ForumThreads/eq/and/ -
    This gets us results from both forums and from social bookmarking.
  • tag/virtualization/eq/and/tag/hyper-v/eq/and/tag/deployment/eq/and - here's our three tags.
  • ?sort=popularity - sorted by popularity.
  • Because we don't specify a time frame, we get the "top" results from the entire database, regardless of date.

Note that the order of the conditions and parameters doesn't matter.

Let us know if you come up with some really useful queries or write some applications based on this. Would love your feedback.

Leave a Comment
  • Please add 4 and 2 and type the answer here:
  • Post
Page 1 of 1 (6 items)