private static Int32 GetObjectID(String url, data.FeedItemType feedItemType) { switch (feedItemType) { case data.FeedItemType.WallComment: return(data.Member.GetMemberViaNickname(UrlProcessor.ExtractWallName(url)).MemberID); case data.FeedItemType.Video: case data.FeedItemType.BookmarkedVideo: return(data.Video.GetVideoByWebVideoIDWithJoin(UrlProcessor.ExtractWebVideoID(url)).VideoID); case data.FeedItemType.Photo: return(data.PhotoCollection.GetPhotoCollectionByWebPhotoCollectionID(UrlProcessor.ExtractWebPhotoCollectionID(url)).PhotoCollectionID); case data.FeedItemType.BookmarkedPhoto: return(data.Photo.GetPhotoByWebPhotoIDWithJoin(UrlProcessor.ExtractWebPhotoID(url)).PhotoID); case data.FeedItemType.Ask: return(data.AskAFriend.GetAskAFriendByWebAskAFriendID(UrlProcessor.ExtractWebAskID(url)).AskAFriendID); case data.FeedItemType.Blog: return(data.BlogEntry.GetBlogEntryByWebBlogEntryID(UrlProcessor.ExtractWebBlogEntryID(url)).BlogEntryID); default: return(0); } }
public void ExtractWebBlogEntryIDTest() { Assert.AreEqual("Yzc4MTk1", UrlProcessor.ExtractWebBlogEntryID("/blog.aspx?m=Y2ZjNDIzMDdiZDE1NDQxM2&b=Yzc4MTk1")); Assert.AreEqual("Mjk5NmU4", UrlProcessor.ExtractWebBlogEntryID("/blog.aspx?m=ZTZlNzE3Y2UzM2U1NGM5OD&b=Mjk5NmU4")); }