Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: C#  |  size: 1.01 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. namespace FriendPulseAdder
  2. {
  3.     static class  Entry
  4.     {
  5.  
  6.         public static string Add(string name, string twitter, string reddit, string rss)
  7.         {
  8.             string half = "{\"name\":\"" + name + "\",\"info\":{\"twitter_name\":\"" + twitter + "\",\"reddit_name\":\"" + reddit + "\"";
  9.             string building = "";
  10.             if (rss == "")
  11.             {
  12.                 return half + "}}";
  13.             }
  14.             else
  15.             {
  16.                 string[] feeds = rss.Split(' ');
  17.                 building = ",\"rss_feeds\":[";
  18.                 foreach (string feed in feeds)
  19.                 {
  20.                     building += "\"" + feed + "\"";
  21.                     if (feed != feeds.Last())
  22.                     {
  23.                         building += ",";
  24.                     }
  25.                     else
  26.                     {
  27.                         building += "]}}";
  28.                     }
  29.                 }
  30.  
  31.                 return half + building;
  32.             }
  33.         }
  34.     }
  35. }