https://github.com/mineur/instagram-parser-bundle
:camera: Symfony integration of Instagram Parser
https://github.com/mineur/instagram-parser-bundle
instagram-parser instagram-scraper php71 symfony-bundle symfony3
Last synced: 5 months ago
JSON representation
:camera: Symfony integration of Instagram Parser
- Host: GitHub
- URL: https://github.com/mineur/instagram-parser-bundle
- Owner: mineur
- License: mit
- Created: 2017-07-01T22:29:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-16T21:42:35.000Z (almost 9 years ago)
- Last Synced: 2025-01-29T09:14:28.371Z (over 1 year ago)
- Topics: instagram-parser, instagram-scraper, php71, symfony-bundle, symfony3
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Twitter Stream API Symfony Bundle
[]()
[](https://packagist.org/packages/mineur/instagram-parser-bundle)
[](https://packagist.org/packages/mineur/instagram-parser-bundle)
A Symfony integration of Mineur Instagram Parser Library.

## Installation
```php
composer require mineur/instagram-parser-bundle:dev-master
```
## Basic initialization
Register this bundle into your application kernel.
```php
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
// ...
new Mineur\InstagramParserBundle\InstagramParserBundle(),
];
}
}
```
Then add your query ID in your config file:
```yaml
# app/config/config.yml
instagram_parser:
query_id: '%your_query_id%'
```
## Simple custom command usage
```php
// Controllers/DemoController.php
class DemoCommand extends ContainerAwareCommand
{
protected function configure()
{
//...
}
public function execute(InputInterface $input, OutputInterface $output)
{
/** @var InstagramParser $instagramParser */
$instagramParser = $this
->getContainer()
->get('instagram_parser');
$instagramParser
->parse(function(InstagramPost $post) {
// you can do whatever you want with this output
// prompt it, enqueue it, persist it into a database ...
$output->writeln($post);
});
}
}
```
Check out the library for full customization of the public stream:
[instagram-parser](https://github.com/mineur/instagram-parser)
## Command line actions
Tu use the pre-configured commands:
* To prompt the stream feed on your terminal:
```php
bin/console mineur:instagram-parser:consume hello
```
* To enqueue the stream output as a serialized objects in a FIFO Redis queue,
type the following:
> This part is subject to RSQueue library and RSQueueBundle. I recommend you to
> check the [RSQueue documentation](https://github.com/rsqueue/RSQueueBundle)
> to consume the enqueued objects.
```php
bin/console mineur:instagram-parser:enqueue
```
## The InstagramPost output
Consuming the stream will give you an infinite loop of hydrated InstagramPost objects,
similar to this one:
```php
Mineur\InstagramParser\Model\InstagramPost {#36
-id: 1539101913268979330
-comment: """
¡Disfruta del sol pero sin quemarte! #wearsunscream #cremasolar
"""
-commentsCount: 0
-shortCode: "BVb_QkdhaC"
-takenAtTimestamp: "149769267"
-dimensions: Mineur\InstagramParser\Model\MediaDimensions {#31
-height: 1079
-width: 1080
}
-likesCount: 21
-mediaSrc: "https://scontent-mrs1-1.cdnins/672_n.jpg"
-thumbnailSrc: "https://cdninstagr.am/84672_n.jpg"
-ownerId: "1103553924"
-video: false
-commentsDisabled: false
}
```