PHP code example of tightenco / simplecast

1. Go to this page and download the library: Download tightenco/simplecast 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/ */

    

tightenco / simplecast example snippets



plecast = Simplecast\ClientFactory::factory([
    'apiKey' => 'your api key here'
]);

$result = $simplecast->podcasts();

var_dump($result);

$result = $simplecast->podcasts();

$result = $simplecast->podcast([
    'podcast_id' => 335
]);

$result = $simplecast->podcastEpisodes([
    'podcast_id' => 335
]);

$result = $simplecast->podcastEpisode([
    'podcast_id' => 335,
    'episode_id' => 11265
]);

$result = $simplecast->podcastEpisodeEmbed([
    'podcast_id' => 335,
    'episode_id' => 11265
]);

$result = $simplecast->podcastEpisodeStatistics([
    'podcast_id' => 335,
    'episode_id' => 11265,
    'timeframe' => 'custom',
    'start_date' => '2015-05-09',
    'end_date' => '2015-05-10'
]);

$result = $simplecast->podcastStatistics([
    'podcast_id' => 335
]);

$result = $simplecast->podcastStatisticsOverall([
    'podcast_id' => 335,
    'timeframe' => 'recent'
]);

array(2) {
  [0]=>
  array(15) {
    ["id"]=>
    int(335)
    ["title"]=>
    string(25) "The Five-Minute Geek Show"
    ["rss_url"]=>
    string(37) "http://simplecast.fm/podcasts/335/rss"
    ["description"]=>
    string(125) "Matt Stauffer, unabashedly geeky, 5 minutes, twice a week. Frontend dev, backend dev, audio, design, podcasts--all fair game."
    ["author"]=>
    string(13) "Matt Stauffer"
    ["copyright"]=>
    string(19) "All rights reserved"
    ["keywords"]=>
    string(92) "geek, technology, php, css, fiveminutegeekshow, it, programming, development, design, ui, ux"
    ["subdomain"]=>
    string(18) "fiveminutegeekshow"
    ["categories"]=>
    array(3) {
      [0]=>
      string(10) "Technology"
      [1]=>
      string(24) "Technology :: Podcasting"
      [2]=>
      string(23) "Technology :: Tech News"
    }
    ["itunes_url"]=>
    string(73) "https://itunes.apple.com/us/podcast/the-five-minute-geek-show/id952727637"
    ["language"]=>
    string(2) "en"
    ["website"]=>
    string(30) "http://fiveminutegeekshow.com/"
    ["twitter"]=>
    string(15) "5minutegeekshow"
    ["explicit"]=>
    bool(false)
    ["images"]=>
    array(3) {
      ["large"]=>
      string(82) "https://simplecast-media.s3.amazonaws.com/podcast/image/335/1419886609-artwork.jpg"
      ["small"]=>
      string(88) "https://simplecast-media.s3.amazonaws.com/podcast/image/335/small_1419886609-artwork.jpg"
      ["thumb"]=>
      string(88) "https://simplecast-media.s3.amazonaws.com/podcast/image/335/thumb_1419886609-artwork.jpg"
    }
  },
  [1] =>
  array(15) {
    ...
  }
}

array(2) {
  ["data"]=>
  array(2) {
    [0]=>
    array(2) {
      ["date"]=>
      string(10) "05-09-2015"
      ["listens"]=>
      int(12345)
    }
    [1]=>
    array(2) {
      ["date"]=>
      string(10) "05-10-2015"
      ["listens"]=>
      int(42)
    }
  }
  ["total_listens"]=>
  int(12387)
}

array(2) {
  ["total_listens"]=>
  int(1234567890)
  ["since"]=>
  string(10) "12-16-2014"
}

array(2) {
  ["data"]=>
  array(22) {
    [0]=>
    array(2) {
      ["date"]=>
      string(10) "04-19-2015"
      ["listens"]=>
      int(12345)
    },
    ...
    [21]=>
    array(2) {
      ["date"]=>
      string(10) "05-10-2015"
      ["listens"]=>
      int(54321)
    }
  }
  ["total_listens"]=>
  int(12345678)
}