Skip to content

Instantly share code, notes, and snippets.

@corypratt
corypratt / cp_get_episode_stats.php
Last active Mar 14, 2019
Wordpress function to get episode stats from Simplecast
View cp_get_episode_stats.php
<?php
/*
* This function can be used to pull total episode stats from Simplecast
*
*/
function cp_get_episode_stats( $podcast_id ) {
if ( ! $podcast_id) {
return "-";
}
@corypratt
corypratt / progress-circle.svg
Created Feb 27, 2018
Progress Circle for FeatherIcons
View progress-circle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:9fa53d2571e19c6c2ae3c51caaf47fa6
if ( $response ) {
$csv = csv_with_headers_to_array( $response['body'] );
if ( array_key_exists('time_period', $csv[0]) ) {
set_transient('_libsyn_transient', 'found', 60 * 60);
set_transient('_libsyn_month', $csv[0]['time_period'], 0);
set_transient('_libsyn_count', $csv[0]['downloads'], 0);
} else {
return;
}
}
View gist:f590198243d3c5d7d509cda8e3d57806
$url = 'https://login.libsyn.com';
$args = array(
'headers' => array(
array( 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' ),
),
'body' => array(
'req' => 'https://four.libsyn.com/stats/ajax-export/show_id/' . $showID . '/type/downloads/target/show/id/' . $showID . '/',
'email' => $email,
'password' => $password
),
You can’t perform that action at this time.