/// <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 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> /// Returns tips from a user. /// </summary> /// <param name="USER_ID">Identity of the user to get tips from. Pass self to get tips 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 FourSquareTips UserTips(string USER_ID, string Sort, string LL, int Limit, int Offset, 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 (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 + "callback=XXX&v=" + Version + "&oauth_token=" + AccessToken; GET.Request(EndPoint); Dictionary<string, object> JSONDictionary = JSONDeserializer(GET.ResponseBody); FourSquareTips Tips = new FourSquareTips(JSONDictionary); return Tips; }