Giter Club home page Giter Club logo

laravel-instagram-feed's Introduction

Laravel Instagram Feed

Build Status

Easily include your Instagram feed(s) in your project.

The aim of this package is to make it as simple and user-friendly as possible to include your Instagram feed in your project, using Instagram's Basic Display API. The package stores the feed in your cache, and provides you with the ability to refresh your feeds on whatever schedule suits you.

Note This package requires PHP 8. If that is not your cup of tea, then you may continue to use v2.

Installation

composer require dymantic/laravel-instagram-feed

Note If you are upgrading from v2.*, refer to the upgrade guide, as there are breaking changes. Also Note This version requires PHP 8 and up, so if you are still on PHP 7 and don't specify a version when you install, composer will pull in ^v2, in which case you should be reading this page.

Tutorial

Some parts of this whole thing can be a bit confusing, especially if you are not familiar with following the OAuth flow. I have included a tutorial to try help make things a bit more clear. Feedback or improvements on this would be most appreciated.

Before you start

To use the Instagram Basic Display API, you will need to have a Facebook app set up with the correct permissions, etc. If you don't have this yet, head over to the Facebook developer docs and follow the instructions.

How Instagram Media is Handled

Instagram provides three media types through this API: image, video and carousel. This package simplifies that into just a feed of images and videos. You may use the ignore_video config option if you don't want to include any videos. For carousel items, the first item of the carousel is used. If video is to be ignored, and the first image will be used, if it exists. Carousel items have a children property, which includes the actual carousel items.

Note on ignoring video

If you chose to ignore video, your feed size may be smaller than the limit you requested. If you expect to be ignoring video posts you may want to increase how many posts you fetch (see "Getting the Feed" below).

Setup

php artisan vendor:publish to publish the necessary migrations and config, and php artisan migrate to run migrations.

Config

Publishing the vendor assets as described above will give you a config/instagram-feed.php file. You will need to add your config before you can get started. The comments in the file explain each of the settings.

// config/instagram-feed.php

<?php

return [
    /*
     * The client_id from registering your app on Instagram
     */
    'client_id'           => 'YOUR INSTAGRAM CLIENT ID',

    /*
     * The client secret from registering your app on Instagram,
     * This is not the same as an access token.
     */
    'client_secret'       => 'YOUR INSTAGRAM CLIENT SECRET',

    /*
     * The base url used to generate to auth callback route for instagram.
     * This defaults to your APP_URL, so normally you may leave it as null
     */
    'base_url' => null,

    /*
     * The route that will respond to the Instagram callback during the OAuth process.
     * Only enter the path without the leading slash. You need to ensure that you have registered
     * a redirect_uri for your instagram app that is equal to combining the
     *  app url (from config) and this route
     */
    'auth_callback_route' => 'instagram/auth/callback',

    /*
     * On success of the OAuth process you will be redirected to this route.
     * You may use query strings to carry messages
     */
    'success_redirect_to' => 'instagram-auth-success',

    /*
     * If the OAuth process fails for some reason you will be redirected to this route.
     * You may use query strings to carry messages
     */
    'failure_redirect_to' => 'instagram-auth-failure'

    /*
     * You may filter out video media types by setting this to true. Carousel media
     * will become the first image in the carousel, and if there are no images, then
     * the entire carousel will be ignored.
     */
     'ignore_video' => false,

    /*
     * You may set an email address below if you wish to be notified of errors when
     * attempting to refresh the Instagram feed.
     */
    'notify_on_error' => null,
];

Profiles

This package provides a Dymantic\InstagramFeed\Profile model which corresponds to an Instagram profile/account. You will need to create a profile for each feed you intend to use in your app/site. Once a profile has been created, you will need to authorize the profile before you can fetch its feed.

Creating profiles

You may create profiles programmatically in your code as follows. All you need is to provide a unique username for the profile. This does not have to match an Instagram username, it can be any name you wish to use to refer to the profile.

$profile = \Dymantic\InstagramFeed\Profile::new('my profile');

Having just a single profile for a project is a fairly common use case, so this package includes an artisan command to quickly create a profile, so that you don't need to build out the necessary UI for your users to do so. Running php artisan instagram-feed:profile {username} will create a profile with that username, that you may then use as desired.

Getting Authorized

Once you have a profile, you may call the getInstagramAuthUrl() method on it to get a link to present to the user that will give authentication. When the user visits that url they can then grant access to your app (or not). If everything goes smoothly, the user will be redirected back to the success_redirect_to route you set in your config file. If access is not granted, you will be redirected to the failure_redirect_to route you configured.

If you have not set your client_id and/or client_secret correctly, or your Instagram app does not accept the user, Instagram won't redirect at all, and your user will see an error from Instagram.

Ignoring the default auth callback route

In some cases you may need to ignore the auth callback route from your config so that you may handle that route yourself, To do this you may call Instgram::ignoreRoutes() from within your AppServiceProvider,

Refreshing access tokens

The long lived access tokens for the API expire after 60 days. This package includes an artisan command that will handle this for you, you just need to ensure that it runs at least once every 60 days. The command is php artisan instagram-feed:refresh-tokens

Getting the feed

Once your profile has been authenticated, you can retrieve the feed either directly from the InstagramFeed class, or by first getting the profile and calling the feed method on it.

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('my profile');

or

$profile = \Dymantic\InstagramFeed\Profile::for('my profile')
$feed = $profile?->feed();

Once the feed is fetched, it will be cached forever and the same cached results will be returned until you refresh the feed. Normally this is done is a scheduled chron job.

Limiting the number of items in the feed

By default, the number of items in the feed is 20. You may pass an optional integer parameter when getting your feed, as such: \Dymantic\InstagramFeed\InstagramFeed::for('my profile', 15) or $profile?->feed(15) to limit the feed to that amount.

Fetching all posts (no limit)

If you want to fetch all your posts (up to the last 1000), you may pass null as the limit parameter to your refreshFeed or feed method. The package will make multiple requests to fetch all your previous posts up to 1000. You may then use the timestamp on the posts to sort, paginate, etc.

Setting limits, and cache

When the feed is being supplied from the cache, the limit will have no affect. If you would like to change the limit to what you previously used, you will have to refresh the feed.

Setting limits and ignore_video

If you chose to ignore video, your feed size may be smaller than the limit you requested. If you expect to be ignoring video posts you may want to increase how many posts you fetch.

Updating the feed

You may refresh the feed similar to how you fetch the reed:

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('my profile')->refresh();

or

$profile = \Dymantic\InstagramFeed\Profile::for('my profile')
$feed = $profile?->refreshFeed();

Refreshing the feed returns an instance of InstagramFeed, however, unlike getting the normal feed, this method can throw an exception if an error occurs. The idea is that you refresh your feeds in the background somewhere, usually in a scheduled job. This package includes an artisan command php artisan instagram-feed:refresh, that will refresh all authorised profiles, and handle errors if they occur. If you have an email address set in the config, that address will be notified in the case of an error. It is recommended to use Laravel's scheduling features to run this command as frequently as you see fit.

Using the feed

Once you have a feed, you may send it to your view, where it may be iterated over, with each item in the feed being an instance of the InstagramMedia class.

// somewhere in a Controller
public function show() {
    $feed = \Dymantic\InstagramFeed\InstagramFeed::for('my profile');

    return view('instagram-feed', ['instagram_feed' => $feed]);
}

// instagram-feed.blade.php

@foreach($instagram_feed as $post)
    <img src={{ $post->url }} alt="A post from my instagram">
@endforeach

If you would like more control over the feed's items, you may call the collect method on the feed to retrieve the feed items as a Laravel Collection.

Feed items

Each feed item is an instance of the InstagramMedia class and provides the following properties and methods:

property type value
type string either "image", "video" or "carousel"
url string the url for the image or video
id string the Instagram id for the image or video
caption string caption for the post
permalink string permalink to post on instagram.com
thumbnail_url string the url for the video thumbnail. Only on video items
timestamp string the timestamp for the post
children array For Carousel type posts. Each item will contain only id, url and type fields. Will be empty array for non-carousel posts.
method return notes
isImage() bool is the post of "image" type
isVideo() bool is the post of "video" type
isCarousel() bool is the post of "carousel" type
toArray() array get the item in array form

laravel-instagram-feed's People

Contributors

adsy2010 avatar ascentcreative avatar christophheich avatar corbancode avatar dependabot[bot] avatar joshuadegier avatar m-lotze avatar michaeljoyner avatar omarmatijas avatar spoyntersmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-instagram-feed's Issues

Cannot feed by tinker - Laravel 9

Hi after i verified all i wanted to feed some images from instagram, but when i try to do it by "$profile->refreshFeed()" or "$profile->Feed(4)" tinker return to me

>>> $profile->refreshFeed()
=> Dymantic\InstagramFeed\InstagramFeed {#3716
     +profile: Dymantic\InstagramFeed\Profile {#3705
       id: 2,
       username: "myname",
       identity_token: "mytoken",
       created_at: "2022-04-11 14:25:09",
       updated_at: "2022-04-11 14:29:10",
     },
   }

Cannot get more than 15 items in a feed.

I'm not sure if this project is actively maintained anymore - but if it is, any insight as to why i can not see more than 15 results at a time? Additionally, is there a way to force latest/oldest posts first?

php artisan instagram-feed:refresh 100

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('profilename',100);

$feed = Profile::where('username', 'profilename')->first()->feed(100);

$schedule->call(function() { Profile::where('username', 'profilename')->first()->refreshFeed(100); })->twiceDaily();

Am i doing something wrong?

Instagram refresh command - specify feed items

Before I start, this is a request which I could put a PR in or leave up to you to determine whether to add it or not.

When refreshing a profiles feed using the refresh feed method, you can optionally choose a number of items $profile->refreshFeed(10) for example. The refresh command currently cycles through all profiles and refreshes by the default number which is 20. I propose adding an optional input to the refresh command {feedItems?} to use as the refresh feed item quantity.

Let me know what you think.

Sorry, we failed to get permission to use your insagram feed.

Hey so I've recently been trying to use this to implement a basic instagram gallery for a website.
So I've setup the code as per the tutorial, upon clicking "allow" on the instagram page, I am re-directed back with '?result=failure#_'
Is there anything specifically that I could be doing wrong?

I'm thinking I may need to request further permissions from instagram? Does this require graph_user_media permissions in the meta developers to run?

I appreciate any help if you have the time to give me a few pointers in the right direction.

Feed Returning A Profile Object Only - Laravel 8 & Vue

Hi

I now have the account all connected and working after upgrading to Laravel 8.

I am fully connected and can see the profile pulling in correctly and the feed items.

My Controller:

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('insta_profile');

return Jetstream::inertia()->render($request, 'PortfolioSummary', [ 'instagram_feed' => $feed ]);

if a dd($feed) it returns the profile and items.

However in the Vue file i can only access the $feed as an Object and only the Profile as an Object.

Can you please update the guzzlehttp/guzzle

I get an error in installation saying dymantic/laravel-instagram-feed v2.3.1 requires guzzlehttp/guzzle ^6.5

I have a project using laravel 8 and "guzzlehttp/guzzle": "^7.0.1"

Can you please update the dependency

PHP version clash?

Hi, I'm trying to integrate your package with my project and I got the following errors in PHP. I was doing so well until then! Thanks for all your hard work. I'm running PHP 8.1.2

PHP Deprecated: Return type of Dymantic\InstagramFeed\InstagramFeed::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forge/test.cyclotour.ch/vendor/dymantic/laravel-instagram-feed/src/InstagramFeed.php on line 42

PHP Deprecated: Return type of Dymantic\InstagramFeed\InstagramFeed::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forge/test.cyclotour.ch/vendor/dymantic/laravel-instagram-feed/src/InstagramFeed.php on line 47

PHP Error: Class name must be a valid object or a string in /home/forge/test.cyclotour.ch/vendor/dymantic/laravel-instagram-feed/src/InstagramFeed.php on line 22

Token refresh issue

Hi, @michaeljoyner
I hope you doing good.
My app has expired and when I run the refresh token command it does not update the token.

php artisan instagram-feed:refresh-tokens

image

refresh-feed doesn't work if run by laravel scheduler

Hi,

I wonder if you can help me diagnose something.

Every few days, my client's IG feed starts returning 302 errors for the images in the feed. The page code only calls "feed" not "refresh" (to save loading times). So, I manually run "php artisan instagram-feed:refresh 200" and it fixes it, as expected.

However, I've set that command to also run in Laravel's scheduler:


$schedule->command('instagram-feed:refresh 200')
                    ->everyMinute()
                    ->emailOutputTo('[email protected]');

        $schedule->command('instagram-feed:refresh-tokens')->monthly(); 

Both tasks show in php artisan schedule:list, and the refresh-tokens is working fine. For some reason, the feed refresh doesn't seem to work though (and I don't get any failure messages either). The feed starts returning 302 codes again, and I have to trigger the command manually to fix it.

Can you shed any light on why this might be?

Laravel 8 - Class "Dymantic\InstagramFeed\InstagramFeed" not found

Hi

Just installed the package, published the vendor files, updated the config and migrated the migrations to the database. All worked fine. Can see the package in the vendor folder. However i am getting the error - Class "Dymantic\InstagramFeed\InstagramFeed" not found

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('my_profile');

Media Expired (URL signature expired) & Refresh Throws http 400 error

Hi

I have just logged into one of my projects and i am receiving this error:

Http request to https://graph.instagram.com/5069349379818774/media?fields=caption,id,media_type,media_url,thumbnail_url,permalink,children{media_type,media_url},timestamp&limit=20&access_token=MYACCESS TOKEN failed with a status of 400 and error message: unknown error

The error points to this part of my code:

$ThisFeed = $profile?->refreshFeed(21);

I remove the code above and then i receive no images, i open the image in a new tab and receive 'URL signature expired' which points to the Instagram CDN image expiring.

Ive added a refresh back in like below:

$feed = \Dymantic\InstagramFeed\InstagramFeed::for('some_account', 21)->refresh()->collect();

However i get the original error which points to this line of code.

Empty array on $profile->feed()

Hello,

I am getting an empty array on $profile->feed(), I am using Laravel 8.

I followed the provided tutorial step by step, everything is perfect without error. the application got allowed with the link and successfully redirected to the provided callback URL, and the token has been generated. But when I try to fetch data with the feed method, I get an empty array without any error.

Getting auth (The OAuth flow)

I'm following the tutorial you made, https://github.com/Dymantic/laravel-instagram-feed/blob/master/tutorial.md

and I think something is wrong with the auth link <a href="{{ $instagram_auth_url }}">Click to get Instagram permission</a> it turns out I get the wrong link. Even though I already fill the config/instagram-feed.php

the link calls back into this.
https://api.instagram.com/oauth/authorize/?client_id=YOUR%20INSTAGRAM%20CLIENT%20ID&redirect_uri=127.0.0.1/instagram/auth/callback&scope=user_profile,user_media&response_type=code&state=1

so the data I already put in config/Instagram-feed.php doesn't change the client_id and redirect_uri

another thing is, in the tutorial under auth_callback_route part, you were saying

Then your config should have the route that matches everything after the forward slash following your app_url (https://example.test/ in this case).

Note that you can use more than one url in your Facebook settings, so you can add a url for local dev as well.

you were saying, we can also put the local URL for local dev. But it turns out, Instagram asking for HTTPS in OAuth Redirect URIs

Actually, I already have done Instagram feed using a CURL PHP script, but I want to know how it does in Laravel 7 with this package. I hope this package can link our website with social media faster than CURL opt.

Token Refresh Cron Instructions not refreshing Token

I have created the token refresh cron as per the guide.

However the token does not refresh and i get an outtage every 60 days.

I have the below in app/console/Kernel.php

protected function schedule(Schedule $schedule) { $schedule->command('instagram-feed:refresh-tokens')->monthly(); }

Undefined array key "media_url"

I am using version laravel-instagram-feed 2.0 . Suddenly I am getting this error.

I am getting this response. media_url key is not there.
array:2 [▼
"media_type" => "IMAGE"
"id" => "17948247578113710"
]

Overwritable credentials using state ID

Initially I created a profile using the artisan command supplied.

So now I have Profile::find(1); available to me

I then created the link as below, obfuscated the real data of course but left the structure:

https://api.instagram.com/oauth/authorize/?client_id=1234567890&redirect_uri=https://site.com/instagram/auth/callback&scope=user_profile,user_media&response_type=code&state=1

state=1 at the end is the user ID from what I can see. I can follow this link as a different user and authorise against that id.

Data stored in feed tokens is not the same username as the one on the profiles table but is linked to the profile ID in the profile table.

So now when I call $profile->feed() I get the feed for the profile I just authorised and not the username that's stored in the profile table.

Suggested solution would be to check the username returned is the same as the one that state id is expecting, otherwise create the profile line and give it a new ID OR throw an error and not accept the account.

Show instagram feed

Hello,

Thank you in advance for your assistance,
Thanks for your plugin

I have a problem when I want to display the Instagram feed I added the profile, the token, everything, and authorize but when displaying the foreach I get the following error

Cannot use object of type Dymantic \ InstagramFeed \ InstagramMedia as array

my sight :
$feed = \Dymantic\InstagramFeed\Profile::where('username', 'myaccount')->first()->feed($limit = 10);

my controller:
return view('frontend.index', compact('categories'))->with(['instagram' => $feed]);

thank you for your help

Carousel_Album

Hi,

Great package - saved me a load of headaches so far!

I just have a query about the carousel item types - is it possible to enable those in full? The docs state that the first item is used, and they seem to be returned as "image" types. However, I noticed the media fields constant includes the "Children" field. It would be great to be able to pull out the data from the feed.

I know I can send a request myself to get that data, but just wondering if there's a method for calling that already within the package to reduce the number of calls etc and take advantage of the package's existing caching.

Many thanks!

Posts without a caption cause the feed refresh to fail

When trying to pull a feed which has at least 1 post without a caption, the entire refresh fails as there is an undefined index of caption.

MediaParser.php should check if the array key 'caption' exists and if not default it to NULL.

Suggestion : offering the thumbnail link

Hello there,

I'm trying to override the parseMedia method... or simply return the default object from Instagram rather than your parsed feed...

I need to get the thumbnail for the video, not the video itself.

Could you add an option to allow this?

Thanks.

Laravel 9 Support?

Tried to install on Laravel 9.0.1, PHP 8.1.2

Problem 1 - Root composer.json requires dymantic/laravel-instagram-feed ^3.0 -> satisfiable by dymantic/laravel-instagram-feed[v3.0.0]. - dymantic/laravel-instagram-feed v3.0.0 requires illuminate/config ^7.0 | ^8.0 -> found illuminate/config[v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.

Could not resolve host: graph.instagram.com

I have had this package on my site for a while now and recently I get this error every now and then. It has resolved it self in the past but it also crashes my site when the error occurs so I am just wondering why. Not sure if its on my end, the package or Instagrams

cURL error 6: Could not resolve host: graph.instagram.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

Redirect to instagram-auth-failure

image

Hi Michael, its me again. We were granted permission from facebook to use instagram_graph_user_profile & instagram_graph_user_media but when I try to use a non tester instagram account im always redirected to instagram-auth-failure route. If I connect using a tester account everything works fine. Is there a way to view the error or exception?

Im sorry for my bad english.
Thank you always for your help and for this great package.

How to get feed without adding users as app testers

Hi Michael its me again sorry to bug you.

Do we need to always add users as app testers in facebook developers ? to get the feeds.
I switched my facebook app to live mode but when I logged in instagram using a non tester account
it returned error code 400 invalid scope.

Question : how to debug the failure ?

Sorry to ask again but, I did make it work correctly on my local computer.

I did deploy it on my distant server, and added the correct Callback URI into the Facebook / Instagram App. There's no error on the Instagram authentication process side, but I get a failure on the callback each time... even I did set it up exactly the same way as I did on the local development environment ...

With only my failure as a return, how can I debug? Thanks.

Can't get the token to register

Hello,

Doing the procedure, I get to the Instagram Autorisation and back to the callback address...

Sadly, Instagram return this as "state"
"state" => "7.4.3162ms18MBGET instagram/auth0 statements were executed0μs"

So the AccessTokenController is unable to find the matching Profile and register the token. What am I doing wrong?

EDIT // I found the issue in my code where it changed the state at the end of the link...

Posts after first page get lost

Instagram Basic API has limitations

Ordering posts is not supported, therefore anything after page 1 is disregarded. For accounts with greater than 99 posts, I propose fetching all results and creating a collection from that using a limit.

Page one results are not the latest posts.

This Issue and PR #19 could allow users to sort posts by their timestamp.

Limit and fields

Is there a reason why the limit of feed items is hardcoded to 20? Could you make this configurable, so that we can get more items? Or even better, add some kind of pagination, like

Profile {
...
    public function feed($limit = 20; $start = 0) {
         ...
    }
...
}

And please add more fields than just the type and media_url. e.g. the caption and the id would be good, so we can link directly to the post.

How can we access the pagination function??

while ($this->shouldFetchNextPage($response, $collection->count(), $limit)) { $response = $this->fetchResponseData($response['paging']['next']); $collection = $collection->merge($response['data']) ->reject(function ($media) { return $this->ignoreVideo($media); }); }

Hi, When I call a var_dump or {{dd($x)}} the ['paging']['next'] is not in the array.

Problem with getting access token

I get this message right after click on allow.

Client error: POST https://api.instagram.com/oauth/access_token resulted in a 400 Bad Request response: {"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure you (truncated...)

image

image

Force Instagram Re-authentication

Hi Michael good day its me again.

Would like to know if its possible for instagram re-authentication when
fetching basic display data?

currently after first successful instagram feed acquisition the account remains logged in instagram
and when I try to fetch a different account feed I need to log out first from instagram with the previous account
before fetching new instagram account feed

Update Typage LOG.warning: Return type

    public function getIterator()
    {
        return new ArrayIterator($this->items);
    }

 LOG.warning: Return type of Dymantic\InstagramFeed\InstagramFeed::getIterator()

    public function count()
    {
        return count($this->items);
    }

LOG.warning: Return type of Dymantic\InstagramFeed\InstagramFeed::count() should either be compatible with Countable::count(): int,


TO

   public function getIterator() : ArrayIterator
    {
        return new ArrayIterator($this->items);
    }

    public function count() : Int
    {
        return count($this->items);
    }

Can you update the function ?

Thank You for your instagram module

update error

Hello! When updating i get this error:

{ "error": { "message": "Syntax error \"Expected \"(\" instead of \",\".\" at character 75: caption,id,media_type,media_url,thumbnail_url,permalink,children.media_type,children.media_url,timestamp", "type": "IGApiException", "code": 2500, "fbtrace_id": "AGDh0xebtg5Q1zRB8TaOlBd" } }

Undefined index: media_url

Hello!

2 days ago, there was a problem in the logs and in the email notification when the data was updated (I am using version 2.6):

[2021-11-09 11:12:16] local.ERROR: Undefined index: media_url {"exception":"[object] (ErrorException(code: 0): Undefined index: media_url at /srv/www/goldenblues/vendor/dymantic/laravel-instagram-feed/src/MediaParser.php:90)

Client error: `GET https://graph.instagram.com/{USER ID}/media?fields=like_count,caption,id,media...

Client error: GET https://graph.instagram.com/3730017507122069/media?fields=like_count,caption,id,media_type,media_url,thumbnail_url,permalink,children%7Bmedia_type,media_url%7D,timestamp&limit=100&access_token={TOKEN}.

resulted in a 403 Forbidden response:
{"error":{"message":"Application does not have permission for this action","type":"IGApiException","code":10,"fbtrace_id (truncated...)

If you uncheck media permission when connecting to Instagram, but confirm the connection anyway. You are met with this error. Any ideas how to resolve it?

instagram-feed:refresh-token issue

When running the refresh token command throws an error due to user changing permissions/password.

image

Can we have it so that it checks if the access token is valid. Or even wrap this function in a try catch?
image

Thanks

Cannot use object of type Dymantic \ InstagramFeed \ InstagramMedia as array

Hello,

Thank you in advance for your assistance,
Thanks for your plugin

I have a problem when I want to display the Instagram feed I added the profile, the token, everything, and authorize but when displaying the foreach I get the following error

Cannot use object of type Dymantic \ InstagramFeed \ InstagramMedia as array

my sight :
$feed = \Dymantic\InstagramFeed\Profile::where('username', 'myaccount')->first()->feed($limit = 10);

my controller:
return view('frontend.index', compact('categories'))->with(['instagram' => $feed]);

thank you for your help

Config APP_URL

Hi Thank you for a remarkable package.
I'm currently using this.

Is there a way where instead of using .env APP_URL variable, use
other .env variables? without editing the package?

image

I'm asking this currently my project is running subdomains, I'm having problem with regards to the callback parameter because of my subdomains

Image thumbnail

Hi michaeljoyner,
I hope that you are doing well, I have been used "laravel-instagram-feed" package to get and show the instagram feeds and it is working fine. I am very impresses with this package and I will recommend to all of you to use it to show the instagram feeds. I am facing a issue, how to fetch the thumbnail size of the image, because when I fetch the feeds and show the feed image in small div size, then the image will lose the quality. Please help me to fix it.
Thanks

Trying to get property 'email' of non-object

If the following command fails: php artisan instagram-feed:refresh

The following error is generated:
ErrorException
Trying to get property 'email' of non-object

This would be because the following variable does not exist in the default config: 'notify_on_error'.

An email should only be attempted if this variable is set. Additionally, this variable should exist by default in the config, but with the default set to NULL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.