From 898e781254dd335910ce82aed99549e0a64484a7 Mon Sep 17 00:00:00 2001 From: Heather Floyd Date: Tue, 25 Apr 2017 16:02:37 -0400 Subject: [PATCH 1/2] New JsonType definition: Place --- oAuthTwitterWrapper/JsonTypes/Place.cs | 108 +++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 oAuthTwitterWrapper/JsonTypes/Place.cs diff --git a/oAuthTwitterWrapper/JsonTypes/Place.cs b/oAuthTwitterWrapper/JsonTypes/Place.cs new file mode 100644 index 0000000..7e2e50e --- /dev/null +++ b/oAuthTwitterWrapper/JsonTypes/Place.cs @@ -0,0 +1,108 @@ +namespace oAuthTwitterWrapper.JsonTypes +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + public class Place + { + + //"id":"778909dfad43f3d6", + //"url":"https:\/\/api.twitter.com\/1.1\/geo\/id\/778909dfad43f3d6.json", + //"place_type":"city", + //"name":"Huddersfield", + //"full_name":"Huddersfield, England", + //"country_code":"GB", + //"country":"United Kingdom", + //"contained_within": + //"bounding_box":{ + // "type":"Polygon", + // "coordinates":[ + // [ + // [ + // -1.896927, + // 53.609424 + // ], + // [ + // -1.726589, + // 53.609424 + // ], + // [ + // -1.726589, + // 53.685361 + // ], + // [ + // -1.896927, + // 53.685361 + // ] + // ] + // ] + // }, + // "attributes":{ + + // } + // }, + + [JsonProperty("id")] + public string Id { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("place_type")] + public string PlaceType { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("full_name")] + public string FullName { get; set; } + + [JsonProperty("country_code")] + public string CountryCode { get; set; } + + [JsonProperty("country")] + public string Country { get; set; } + + [JsonProperty("contained_within")] + public object ContainedWithin { get; set; } + + [JsonProperty("bounding_box")] + public object BoundingBox { get; set; } + + } + + public class BoundingBox + { + // "type":"Polygon", + // "coordinates":[ + // [ + // [ + // -1.896927, + // 53.609424 + // ], + // [ + // -1.726589, + // 53.609424 + // ], + // [ + // -1.726589, + // 53.685361 + // ], + // [ + // -1.896927, + // 53.685361 + // ] + // ] + // ] + // }, + // "attributes":{ + // } + + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("coordinates")] + public JArray Coordinates { get; set; } + } + +} From 4e58b9c5c1e382a25a2587ca8ca04b87d076ac04 Mon Sep 17 00:00:00 2001 From: Heather Floyd Date: Tue, 25 Apr 2017 16:02:37 -0400 Subject: [PATCH 2/2] New JsonType definition: Place --- oAuthTwitterWrapper/JsonTypes/TimeLine.cs | 93 +++++++++++------------ 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/oAuthTwitterWrapper/JsonTypes/TimeLine.cs b/oAuthTwitterWrapper/JsonTypes/TimeLine.cs index 174c1c1..aaf98ed 100644 --- a/oAuthTwitterWrapper/JsonTypes/TimeLine.cs +++ b/oAuthTwitterWrapper/JsonTypes/TimeLine.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace OAuthTwitterWrapper.JsonTypes +namespace OAuthTwitterWrapper.JsonTypes { + using Newtonsoft.Json; + using oAuthTwitterWrapper.JsonTypes; public class TimeLine { @@ -12,68 +9,68 @@ public class TimeLine [JsonProperty("created_at")] public string CreatedAt { get; set; } - [JsonProperty("id")] - public string Id { get; set; } + [JsonProperty("id")] + public string Id { get; set; } - [JsonProperty("id_str")] - public string IdStr { get; set; } + [JsonProperty("id_str")] + public string IdStr { get; set; } - [JsonProperty("text")] - public string Text { get; set; } + [JsonProperty("text")] + public string Text { get; set; } - [JsonProperty("source")] - public string Source { get; set; } + [JsonProperty("source")] + public string Source { get; set; } - [JsonProperty("truncated")] - public bool Truncated { get; set; } + [JsonProperty("truncated")] + public bool Truncated { get; set; } - [JsonProperty("in_reply_to_status_id")] - public string InReplyToStatusId { get; set; } + [JsonProperty("in_reply_to_status_id")] + public string InReplyToStatusId { get; set; } - [JsonProperty("in_reply_to_status_id_str")] - public string InReplyToStatusIdStr { get; set; } + [JsonProperty("in_reply_to_status_id_str")] + public string InReplyToStatusIdStr { get; set; } - [JsonProperty("in_reply_to_user_id")] - public string InReplyToUserId { get; set; } + [JsonProperty("in_reply_to_user_id")] + public string InReplyToUserId { get; set; } - [JsonProperty("in_reply_to_user_id_str")] - public string InReplyToUserIdStr { get; set; } + [JsonProperty("in_reply_to_user_id_str")] + public string InReplyToUserIdStr { get; set; } - [JsonProperty("in_reply_to_screen_name")] - public string InReplyToScreenName { get; set; } + [JsonProperty("in_reply_to_screen_name")] + public string InReplyToScreenName { get; set; } - [JsonProperty("user")] - public User User { get; set; } + [JsonProperty("user")] + public User User { get; set; } - [JsonProperty("geo")] - public string Geo { get; set; } + [JsonProperty("geo")] + public string Geo { get; set; } - [JsonProperty("coordinates")] - public string Coordinates { get; set; } + [JsonProperty("coordinates")] + public string Coordinates { get; set; } - [JsonProperty("place")] - public string Place { get; set; } + [JsonProperty("place")] + public Place Place { get; set; } - [JsonProperty("contributors")] - public string Contributors { get; set; } + [JsonProperty("contributors")] + public string Contributors { get; set; } - [JsonProperty("retweet_count")] - public int RetweetCount { get; set; } + [JsonProperty("retweet_count")] + public int RetweetCount { get; set; } - [JsonProperty("favorite_count")] - public int FavoriteCount { get; set; } + [JsonProperty("favorite_count")] + public int FavoriteCount { get; set; } - [JsonProperty("entities")] - public Entities Entities { get; set; } + [JsonProperty("entities")] + public Entities Entities { get; set; } - [JsonProperty("favorited")] - public bool Favorited { get; set; } + [JsonProperty("favorited")] + public bool Favorited { get; set; } - [JsonProperty("retweeted")] - public bool Retweeted { get; set; } + [JsonProperty("retweeted")] + public bool Retweeted { get; set; } - [JsonProperty("lang")] - public string Lang { get; set; } + [JsonProperty("lang")] + public string Lang { get; set; } } }