Download the PHP package pvlima/media-feed without Composer

On this page you can find all versions of the php package pvlima/media-feed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package media-feed

pvlima/media-feed

API para obter o feed de publicações de uma página do Instagram

Instalação

É recomendável instalar o pacote usando o composer. Basta digitar o seguinte comando no terminal:

  composer require pvlima/media-feed

Exemplo:

O construtor da classe Pvlima\MediaFeed\Instagram\InstagramAPI() deve receber a instância de Pvlima\MediaFeed\Cache\CacheManager('diretorio/de/cache') para que guarde informações importantes da requisição.

include 'vendor/autoload.php';

$cache = new \Pvlima\MediaFeed\Instagram\Cache\CacheManager(__DIR__ . '/cache/');

$api   = new \Pvlima\MediaFeed\Instagram\InstagramAPI($cache);

$api->setUserName('pvlima2');

$feed = $api->getFeed();
echo print_r($feed);

Outras Configurações

Em cada request são exibidas as últimas 12 postagens da página, caso necessite paginar e ir visualizando as postagens seguintes, deve ser utilizado o cursor de paginação. Em cada request, como no exemplo acima, é informado o endCursor, que é o cursor da próxima página de posts. Para visitar a próxima página, basta informar o endCursor obtido no request anterior:

include 'vendor/autoload.php';

$cache = new \Pvlima\MediaFeed\Instagram\Cache\CacheManager(__DIR__ . '/cache/');

$api   = new \Pvlima\MediaFeed\Instagram\InstagramAPI($cache);

$api->setUserName('pvlima2');

$api->setEndCursor('AQB3YFhMu38VUyjhyvLe3EkoV0zvW5In_cDK8ZD8h7VbJOhKp5CRCq5lsXJJ2fjsubA');

$feed = $api->getFeed();
echo print_r($feed);

Neste caso, a variável $feed é uma instância de \Pvlima\MediaFeed\Instagram\Model\Feed, e pode ser manipulada de acordo com os métodos correspondentes:

echo $feed->getFullName();
echo $feed->getBiography();
echo $feed->getFollowers();

É possível também trabalhar diretamente com as postagens através do método $feed->getMedias() que retorna um array contendo as postagens que são instâncias de \Pvlima\MediaFeed\Instagram\Model\Media, e podem ser manipuladas de acordo com os métodos correspondentes:

foreach($feed->getMedias() as $media){
      //Para obter o link da imagem do post
      echo $media->getThumbnailSrc();
}

All versions of media-feed with dependencies

PHP Build Version
Package Version
Requires ext-curl Version *
ext-json Version *
guzzlehttp/guzzle Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pvlima/media-feed contains the following files

Loading the files please wait ...