Hi there, everybody.
My first ever forum post on here.

I need some help with working with the Skybrud.Social nuget package. It's known to be quite handy for Instagram related coding. In my application, basically all I am required to do, is fetch a definite number of the most popular insta_ posts [say 25] based on a definite search tag, say 'GlacialMelting'. And of course show them in my application.

Let me post some code::
  1. @using WTRD.UI.Models  
  2. @using WTRD.UI.HelperClasses  
  3. @using TweetSharp;  
  4. @using TweetSharp.Model;  
  5. @using Skybrud.Social;  
  6. @using Skybrud.Social.Instagram  
  7. @using Skybrud.Social.Instagram.Options.Tags  
  8. @using Skybrud.Social.Instagram.Responses  
  9. @inherits WebViewPage  
  10.   
  11. "text/javascript">  
  12.       
  13.   
  14. "text/css">  
  15.     .insta:not(:first-child)  
  16.     {  
  17.         padding-top:9px;  
  18.     }  
  19.     .insta .li{  
  20.         float:none  
  21.     }  
  22.   
  23.   
  24. @{  
  25.   
  26.     List temp_1 = new List();  
  27.      
  28.     InstagramService service = InstagramService.CreateFromClientId(System.Configuration.ConfigurationManager.AppSettings["instaID"].ToString());  
  29.   
  30. ---->    InstagramGetTagRecentMediaOptions option1 = new InstagramGetTagRecentMediaOptions  
  31.     {  
  32.         Tag = "ClimateChange",  
  33.         Count = 15  
  34.     };  
  35.   
  36.     InstagramGetRecentMediaResponse response1 = Model.Tags.GetRecentMedia(option1);  
  37.     
  38.     temp_1.AddRange(response1.Body.Data);  
  39.     if (temp_1.Count == 0)  
  40.     {  
  41.   
  42.         option1.MaxTagId = response1.Body.Pagination.NextMaxId;  
  43.         response1 = Model.Tags.GetRecentMedia(option1);  
  44.         temp_1.AddRange(response1.Body.Data);  
  45.     }  
  46.   
  47.     class="table list">  
  48.         @{  
  49.             int nr = 1;  
  50.             foreach (Skybrud.Social.Instagram.Objects.InstagramMedia media in temp_1)  
  51.             {  
  52.                   
  53.                     @(nr++).  
  54.                     @media.Id  
  55.                     class="nw">@media.Created.ToLocalTime()  
  56.                       
  57.                         "@media.Thumbnail" style="float: left;" />  
  58.                         "margin-left: 160px;">  
  59.                             @media.CaptionText  
  60.                         
  
  •                       
  •                   
  •             }  
  •         }  
  •       
  •   
  •   
  •