-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not have details on how to use the filter to search for specific hashtag! #734
Comments
@viktor-morin it is not working for me. I am using the below code. Please check it. var userFeed = new Instafeed({
|
When working with this, I could see that you could iterate each picture and apply your own "filter". Sorry I didnt saved the JS implementation. public async Task<IEnumerable<InstagramPostDto>> GetInstagramPosts()
{
var token = await GetAccessToken();
var baseUrl = "https://graph.instagram.com/me/media?fields=caption,media_type,permalink,media_url&limit=100&access_token=";
var response = await _httpClient.GetAsync($"{baseUrl}{token}");
if (!response.IsSuccessStatusCode)
return default;
var results = new List<InstagramPostDto>();
var responseJson = await response.Content.ReadAsStringAsync();
var jObject = JObject.Parse(responseJson);
var datas = jObject["data"].ToObject<IEnumerable<JObject>>();
foreach (var data in datas)
results.Add(new InstagramPostDto {
Caption = data["caption"].ToObject<string>(),
MediaType = data["media_type"].ToObject<string>(),
ThumbnailImageUrl = data["media_url"].ToObject<string>(),
Url = data["permalink"].ToObject<string>() });
while (jObject["paging"].ToObject<JObject>().ContainsKey("next"))
{
var nextPageUrl = jObject["paging"]["next"].ToObject<string>();
response = await _httpClient.GetAsync(nextPageUrl);
if (!response.IsSuccessStatusCode)
return default;
responseJson = await response.Content.ReadAsStringAsync();
jObject = JObject.Parse(responseJson);
datas = jObject["data"].ToObject<IEnumerable<JObject>>();
foreach (var data in datas)
results.Add(new InstagramPostDto
{
Caption = data["caption"].ToObject<string>(),
MediaType = data["media_type"].ToObject<string>(),
ThumbnailImageUrl = data["media_url"].ToObject<string>(),
Url = data["permalink"].ToObject<string>()
});
}
return results.Where(r => r.Caption?.ToLowerInvariant()?.Contains("#fusklapp") == true);
} |
Does not have details on how to use the filter to search for specific hashtag of the desired profile, it would be nice to have a hashtag filter to fetch only the tag I want
The text was updated successfully, but these errors were encountered: