Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active December 12, 2015 10:19
Show Gist options
  • Save yetanotherchris/4757954 to your computer and use it in GitHub Desktop.
Save yetanotherchris/4757954 to your computer and use it in GitHub Desktop.
JQuery web service
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class GetFeeds : System.Web.Services.WebService
{
[WebMethod]
public FeedItemSummary[] FilterFeeds(string arg1,string arg2)
{
// Load a list of feeds based on the arguments
...
// Turn into HTML friendly format
List<FeedItemSummary> summaryList = new List<FeedItemSummary>();
foreach (FeedItem item in list)
{
FeedItemSummary summary = new FeedItemSummary();
summary.Title = item.Title;
summary.PublishDate = item.PublishDate.ToString("dddd dd MMM yyyy");
summary.Content = item.Html;
summary.Hash = item.Hash;
summary.FeedImage = item.ImageTag;
summary.Url = item.Url;
summary.TldName = "etc...";
summaryList.Add(summary);
}
return summaryList.ToArray();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment