diff --git a/InstaSharper/Classes/Models/InstaActivityFeedType.cs b/InstaSharper/Classes/Models/InstaActivityFeedType.cs new file mode 100644 index 00000000..0a7b7056 --- /dev/null +++ b/InstaSharper/Classes/Models/InstaActivityFeedType.cs @@ -0,0 +1,11 @@ +namespace InstaSharper.Classes.Models +{ + public enum InstaActivityFeedType + { + Comment = 12, + Like = 60, + Follow = 101, + TaggedYou = 102, + SupportRequest = 119, + } +} \ No newline at end of file diff --git a/InstaSharper/Classes/Models/InstaRecentActivityFeed.cs b/InstaSharper/Classes/Models/InstaRecentActivityFeed.cs index 11786cd7..ca54c906 100644 --- a/InstaSharper/Classes/Models/InstaRecentActivityFeed.cs +++ b/InstaSharper/Classes/Models/InstaRecentActivityFeed.cs @@ -5,8 +5,12 @@ namespace InstaSharper.Classes.Models { public class InstaRecentActivityFeed { + public string MediaId { get; set; } + public long ProfileId { get; set; } + public string ProfileName { get; set; } + public string ProfileImage { get; set; } public DateTime TimeStamp { get; set; } @@ -14,8 +18,10 @@ public class InstaRecentActivityFeed public string Text { get; set; } public List Links { get; set; } = new List(); + public InstaInlineFollow InlineFollow { get; set; } - public int Type { get; set; } + + public InstaActivityFeedType Type { get; set; } public string Pk { get; set; } } diff --git a/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityFeedResponse.cs b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityFeedResponse.cs index 6ee98531..d1b29ea3 100644 --- a/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityFeedResponse.cs +++ b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityFeedResponse.cs @@ -6,7 +6,7 @@ public class InstaRecentActivityFeedResponse { [JsonProperty("args")] public InstaRecentActivityStoryItemResponse Args { get; set; } - [JsonProperty("type")] public int Type { get; set; } + [JsonProperty("story_type")] public int Type { get; set; } [JsonProperty("pk")] public string Pk { get; set; } } diff --git a/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemMediaResponse.cs b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemMediaResponse.cs new file mode 100644 index 00000000..e3849385 --- /dev/null +++ b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemMediaResponse.cs @@ -0,0 +1,9 @@ +using Newtonsoft.Json; + +namespace InstaSharper.Classes.ResponseWrappers +{ + public class InstaRecentActivityStoryItemMediaResponse + { + [JsonProperty("id")] public string MediaId { get; set; } + } +} \ No newline at end of file diff --git a/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemResponse.cs b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemResponse.cs index b2021454..069ff12b 100644 --- a/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemResponse.cs +++ b/InstaSharper/Classes/ResponseWrappers/InstaRecentActivityStoryItemResponse.cs @@ -7,6 +7,8 @@ public class InstaRecentActivityStoryItemResponse { [JsonProperty("profile_id")] public long ProfileId { get; set; } + [JsonProperty("profile_name")] public string ProfileName { get; set; } + [JsonProperty("profile_image")] public string ProfileImage { get; set; } [JsonProperty("timestamp")] public string TimeStamp { get; set; } @@ -16,5 +18,7 @@ public class InstaRecentActivityStoryItemResponse [JsonProperty("text")] public string Text { get; set; } [JsonProperty("links")] public List Links { get; set; } + + [JsonProperty("media")] public List Medias { get; set; } } } \ No newline at end of file diff --git a/InstaSharper/Converters/InstaRecentActivityConverter.cs b/InstaSharper/Converters/InstaRecentActivityConverter.cs index 7c81c0f5..cd9518ea 100644 --- a/InstaSharper/Converters/InstaRecentActivityConverter.cs +++ b/InstaSharper/Converters/InstaRecentActivityConverter.cs @@ -1,4 +1,5 @@ -using InstaSharper.Classes.Models; +using System.Linq; +using InstaSharper.Classes.Models; using InstaSharper.Classes.ResponseWrappers; using InstaSharper.Helpers; @@ -14,11 +15,13 @@ public InstaRecentActivityFeed Convert() var activityStory = new InstaRecentActivityFeed { Pk = SourceObject.Pk, - Type = SourceObject.Type, + Type = (InstaActivityFeedType) SourceObject.Type, ProfileId = SourceObject.Args.ProfileId, + ProfileName = SourceObject.Args.ProfileName, ProfileImage = SourceObject.Args.ProfileImage, Text = SourceObject.Args.Text, - TimeStamp = DateTimeHelper.UnixTimestampToDateTime(SourceObject.Args.TimeStamp) + MediaId = SourceObject.Args.Medias?.FirstOrDefault()?.MediaId, + TimeStamp = DateTimeHelper.UnixTimestampToDateTime(SourceObject.Args.TimeStamp.Split('.')[0]) }; if (SourceObject.Args.Links != null) foreach (var instaLinkResponse in SourceObject.Args.Links)