PHP code example of arillo / silverstripe-instagram-scraper

1. Go to this page and download the library: Download arillo/silverstripe-instagram-scraper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arillo / silverstripe-instagram-scraper example snippets


public function getInstagramRecords()
{
  // get records by topic (subject & type)
  $records = InstagramRecord::by_topic(<subject>, <type>);

  // $records is a data list, the query can be modified...
  return $records
    ->exclude('Hidden', true)
    ->limit(10)
    ->sort('TakenAtTimestamp DESC')
  ;
}

php framework/cli-script.php dev/tasks/Arillo-InstagramScraper-Tasks-ScraperTask type=hashtag subject=<the_hashtag_to_query>

php framework/cli-script.php dev/tasks/Arillo-InstagramScraper-Tasks-ScraperTask type=username subject=<the_username_to_query>

php framework/cli-script.php dev/tasks/Arillo-InstagramScraper-Tasks-ScraperTask type=location subject=<instagram_location_id>