Coder Social home page Coder Social logo

contao-instagram's People

Contributors

fritzmg avatar kaipk avatar qzminski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

contao-instagram's Issues

Instagram erlaubt keine Verbindung

Ich bin auf Contao 4.9

Wenn ich meinen Feed aktualisieren möchte, indem ich das Kontrollkästchen "Token" aktiviere, wird folgende Meldung angezeigt: "Instagram erlaubt keine Verbindung"

Likes & Comments missing

since the update, data for the likes and the comments seem to be missing.
before we could use the $item['likes']['count'] and $item['comments']['count'].

Is this information still available in the new API?
Would it be possible to add them again?

Missing auto update of posts inside Instagram Feed [Frontend Module]

Hello Kamil,

we want to use your extension in a new Contao 4.13.38 project. I had installed the extension (Version 2.3.5) a couple of weeks ago and are currently wondering why the feed won't be updated. Since than a couple of postings were made on Instagram. But in the frontend I can only see data from the past.

Did I miss to configure an update trigger?

Kind regards
Dennis

Within the config.yml I have:

    access_token_ttl: 28800 # 8h access token local time to live after which Contao will make a request to refresh the token, in seconds
    cache_ttl: 1800 # 30 min feed data cache local time to live, in seconds

uploaded video destroys instagram widget

Hi,
my customer uploaded a video to his instagram account, now the video is written to the src="" attribute without any query and destroys the feed:

Bildschirmfoto 2020-07-10 um 19 09 13

Bildschirmfoto 2020-07-10 um 19 18 42

is there any way to treat them separately or sort them out?

Handle RequestException for empty/invalid media data

As discussed on slack (https://contao.slack.com/archives/CLTUNH78X/p1657699418985049), there might be a problem if instagram answers with empty media data.

The $url is not set here:

switch ($item['media_type']) {
case 'IMAGE':
case 'CAROUSEL_ALBUM':
$url = $item['media_url'];
break;
case 'VIDEO':
$url = $item['thumbnail_url'];

The empty $url leads to a GuzzleHttp\Exception\RequestException which is not catched here:

} catch (ClientException | ConnectException | ServerException $e) {

The exception should be catched and/or empty $url should be handled

Refresh instagram access token with cronjob

At the moment, long-lived instagram tokens expire after 60 days, making it necessary to create a new token about every two months. This is tedious, tbh.

Is there a possiblity to add a cronjob to the bundle, that refreshes the token after e.g. 30 days via the corresponding endpoint of the Basic Display API?

Long lived access tokens

We already got several clients calling, asking why the feed is not showing posts anymore...

Thank you very much!

preview images hosted by Contao for instagram media types VIDEO & CAROUSEL_ALBUM

Now that video & carousels are included, we would love to have also preview images of those types in Contao.
So we do not need to load the preview images external from instagram.

if "media_type" => "VIDEO" the is a preview image in "thumbnail_url"
if "media_type" => "CAROUSEL_ALBUM" the is the first image in "media_url"

would it be possible to download those images to Contao and use them just as we can use the images of the normal image posts?

numberOfItems = 0 breaks fe module

Hi
after installing the module on Contao 4.7 and adding the FE-Module everything worked fine until I changed the value of field numberOfItems to 0.

After doing so there is no output for the FE-Module anymore and no error in /var/logs/.

cURL error if instagram is down

The module does not catch the cURL error if instagram ist not reachable.

request.CRITICAL: Uncaught PHP Exception GuzzleHttp\Exception\ConnectException: "cURL error 6: Could not resolve host: graph.instagram.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)" at /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 200 {"exception":"[object] (GuzzleHttp\Exception\ConnectException(code: 0): cURL error 6: Could not resolve host: graph.instagram.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200)"} []

No connection to Instagram when date format isn't set correctly

Hi Kamil,

yesterday i installed the Instagram bundle, generated die Client ID and secret, got the asscess token.

After including the module into an article nothing is shown. No media also also no code when checking the source code.

Today i found out that the date format in settings wasn't set right.
H.i instead of H:i

After setting to H:i all media are shown in frontend.
May be a hint to build some code in to show an error or giving a hint.

Cheers
Thomas

Unregelmäßiger Bug bei Videoanzeige

Module not working anymore because instagram changed the api calls

instagram changed the api and now the module is not working anymore. see -> https://www.instagram.com/developer/changelog/ - some endpoints are deprecated.

ps: your module is great

i think you can fix it like that

in InstagramModule.php line 91

....

 /*if (($userId = $this->fetchUserId()) === null) {
            return [];
  }*/

//fetchUserId not neccecary now, because instagram allows only self data

$response = $this->sendRequest(sprintf('https://api.instagram.com/v1/users/self/media/recent', $userId), ['count' => $this->numberOfItems]);

.....

request Access Token no longer working

If I click the checkbox to get an Access Token, I get this JSON error.

error_typeOAuthException
code400
error_messageInvalid scope field(s): public_content

Access token refresh

Hi guys—very nice improvement to this extension! After reviewing the code, I'm wondering if the long-lived access token will simply expire after 60 days, or will it remain valid? I don't see any functionality built in here to reresh the access token, so I'm worried about leaving this on a client's site for more than a couple of months. Thoughts?

Invalid scope

Hi, basically this bundle works well for me. But from time to time the images stop appearing. I tried to get a new access token, but I always get this error:

{"error_type": "OAuthException", "code": 400, "error_message": "Invalid scope: []"}

What can I do to fix that?

Thank you,

Best regards,
Daniel

Error validating Access Token

The module does not work permanently. After a certain time, nothing is displayed and the corresponding error message is in the log, see picture.
83943221-ae878100-a7fa-11ea-9e8f-b6a5b1b9febd

The installed version is 2.1.2. Do you have a solution for this?

Feed doesn't update on new Insta-Post

Unfortunately it is still necessary to request a new access token to get the newest post - can anybody reproduce this?

Contao: 4.4.45
contao-instagram: 2.10

Unterschiedliche Auflösungen zur Auswahl hinzufügen

Über die Api gibt es unterschiedliche Auflösungen die man mit in der Modulkonfiguration packen könnte

thumbnail ->width: 150, height: 306
low_resolution -> width: 306, height: 306
standard_resolution -> width: 612, height: 612

z. B.:
<?php
$item['images']['thumbnail']['url']
$item['images']['thumbnail'] ['width']
$item['images']['thumbnail']['height']
....
<img src="<?= $item['images']['thumbnail']['url'] ?>" alt="<?= specialchars($item['caption']['text']) ?> width="<?= $item['images']['thumbnail']['width'] ?>" height="<?= $item['images']['thumbnail']['height'] ?>">

Gruß Olli

Call to undefined method TreeBuilder::getRootNode()

Hi Kamil,

I run into a problem with the lastest version commited some days ago with a Contao 4.4.47 installation. The Contao Manager exits with an undefined error. Here is the stack-trace:

> Resolving dependencies using Composer Cloud v2.2.6

$ /usr/local/bin/ed-php-cli-73 -q /home/vz531nap/www/home/clients/_c44/web/contao-manager.phar.php composer install --prefer-dist --no-dev --no-progress --no-suggest --no-ansi --no-interaction --optimize-autoloader

ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
contao/manager-plugin: Generating plugin class...
contao/manager-plugin: ...done generating plugin class

Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Config\Definition\Builder\TreeBuilder::getRootNode() in /home/vz531nap/www/home/clients/_c44/vendor/codefog/contao-instagram/src/DependencyInjection/Configuration.php:16
Stack trace:
-0 /home/vz531nap/www/home/clients/_c44/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Processor.php(50): Codefog\InstagramBundle\DependencyInjection\Configuration->getConfigTreeBuilder()
-1 /home/vz531nap/www/home/clients/_c44/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/Extension.php(102): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(Codefog\InstagramBundle\DependencyInjection\Configuration), Array)
-2 /home/vz531nap/www/home/clients/_c44/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php(35): Symfony\Component\DependencyInjection\Extension\Extension->processConfiguration(Object(Codefog\InstagramBundle\DependencyInjection\Configu in /home/vz531nap/www/home/clients/_c44/vendor/codefog/contao-instagram/src/DependencyInjection/Configuration.php on line 16
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 0 installs, 1 update, 0 removals
  - Updating codefog/contao-instagram (2.1.0 => 2.1.1): As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them.
Loading from cache
Generating optimized autoload files
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception

In ScriptHandler.php line 113:
                                                                           
  An error occurred while executing the "contao:install-web-dir" command:  
                                                                           

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>...]


 Process terminated with exit code 1
 Result: General error

---

Thanks a lot,
Sascha

Uncaught PHP Exception GuzzleHttp\Exception\RequestException: "cURL error 3: <url> malformed

Hello, I am using the extension for the first time and get an error message:

It runs fine for a while, then after a few minutes the error chops the whole page

Contao 4.9.3
GuzzleHttp/6.5.5
curl/7.58.0
PHP/7.4.5

[2020-06-19 09:22:19] request.INFO: Matched route "tl_page.2.root". {"route":"tl_page.2.root","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","_route":"tl_page.2.root"},"request_uri":"https://www.z-connection.de/","method":"GET"} []
[2020-06-19 09:22:19] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2020-06-19 09:22:19] request.CRITICAL: Uncaught PHP Exception GuzzleHttp\Exception\RequestException: "cURL error 3: <url> malformed (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)" at /www/htdocs/[REMOVED]/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 201 {"exception":"[object] (GuzzleHttp\\Exception\\RequestException(code: 0): cURL error 3: <url> malformed (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /www/htdocs/[REMOVED]/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201)"} []

Stacktrace:
contao-instagram_error.txt

Integrity constraint violation: 1062 Duplicate entry

After updating from an older v1 version of this plugin we get this error:

Integrity constraint violation: 1062 Duplicate entry '53' for key 'PRIMARY'" at /var/www/vhosts/***/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 74 null []

We could get a Instagram Access Token and the images are sucessfully downloaded.
But the frontend generates this error.

Error while setting up on Contao 4.13.4

When I try to request the access token (fresh install), I am redirected to Instagram; then I allow the app to share information, and after clicking on "Allow", I get redirected to my installation where the following error is displayed:

Attempted to call an undefined method named "fetchAssoc" of class "Doctrine\DBAL\Connection". Did you mean to call "fetchAssociative"?

Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "fetchAssoc" of class "Doctrine\DBAL\Connection". Did you mean to call "fetchAssociative"?" at /var/www/vhosts/client/httpdocs/contao-4-13/vendor/codefog/contao-instagram/src/Controller/InstagramController.php line 92 { "exception": {} }

Stack trace:

Symfony\Component\ErrorHandler\Error\UndefinedMethodError:
Attempted to call an undefined method named "fetchAssoc" of class "Doctrine\DBAL\Connection".
Did you mean to call "fetchAssociative"?

at vendor/codefog/contao-instagram/src/Controller/InstagramController.php:92
at Codefog\InstagramBundle\Controller\InstagramController->authAction()
(vendor/symfony/http-kernel/HttpKernel.php:152)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:74)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:202)
at Symfony\Component\HttpKernel\Kernel->handle()
(web/index.php:44)

Changing "fetchAssoc" to "fetchAssociative" in vendor/codefog/contao-instagram/src/Controller/InstagramController.php line 92 solved the problem for me.

An unexpected error has occured

Hi!

I installed contao-instagram, set it all up and it seemed to work just fine.
It retrieved the Access Token and the frontend module displayed postings from IG on the website.
A few hours later i started getting this error in the Contao log whenever i open the page with the module...

Unable to fetch Instagram data from "https://graph.instagram.com/me/media": Server error: GET https://graph.instagram.com/me/media?access_token=TokenReplacedByMe&fields=id%2Ccaption%2Cmedia_type%2Cmedia_url%2Cpermalink%2Cthumbnail_url%2Ctimestamp resulted in a 500 Internal Server Error response: {"error":{"message":"An unexpected error has occurred. Please retry your request later.","type":"OAuthException","is_tra (truncated...)

...and the content element is not displayed at all on the page.

I thought maybe the token had expired so i request a new one, which worked but didn't solve the problem.
Not sure if this is a problem with Instagram or contao-instagram because of the error code 500. Is anyone else getting this?

Instagram API Endpoints retired

Seems like instagram retired some api endpoins.

https://api.instagram.com/v1/users/search, Array ( [q] =>xxxxxx [count] => 1 [access_token] => xxxxxx ) , Array ( [meta] => Array ( [code] => 400 [error_type] => APINotAllowedError [error_message] => This endpoint has been retired ) )

doctrine/cache requirement

Hi Kamil,

could you please check if its possible to update this requirement:

        "doctrine/cache": "^1.9",

it competes with the settings of metamodels which I need in a project:

Problem 1
    - codefog/contao-instagram[2.3.0, ..., 2.3.5] require doctrine/cache ^1.9 -> found doctrine/cache[1.9.0, ..., 1.13.0] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires codefog/contao-instagram ^2.3 -> satisfiable by codefog/contao-instagram[2.3.0, ..., 2.3.5].
    - metamodels/core dev-feature/2.3.0 requires doctrine/cache ^2.1 -> found doctrine/cache[2.1.0, 2.1.1, 2.2.0] but it conflicts with your root composer.json require (^1.9).

thanks!

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.