Skip to content

Instantly share code, notes, and snippets.

View jwcounts's full-sized avatar

Jared Counts jwcounts

View GitHub Profile
@jwcounts
jwcounts / pbsLlsParentMessage.js
Last active April 16, 2024 19:39
PBS GA LivePlayer Parent Message
const inIframe = () => {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
window.addEventListener('DOMContentLoaded', (event) => {
if ( inIframe() ) {
console.log( 'loading in iframe' );
@jwcounts
jwcounts / s3_example.php
Created October 19, 2022 03:40
Code example using Marco Arment's S3 Class
<?php
// You can either include or require the file. That will bring the class into your script
require "s3.php";
// Replace the variables below with your AWS credentials
$aws_key = 'YOUR AWS KEY';
$aws_secret = 'YOUR AWS SECRET';
$bucket_name = 'S3 BUCKET NAME';
$region = 'S3 BUCKET REGION';
$custom_endpoint = 'CUSTOM ENDPOINT'; // Can leave blank

Keybase proof

I hereby claim:

  • I am jwcounts on github.
  • I am jwcounts (https://keybase.io/jwcounts) on keybase.
  • I have a public key ASBUJIToBaBqoI3T9FOammTIX9zEGwp2r6POgZ3Q9MJXFgo

To claim this, I am signing this object:

@jwcounts
jwcounts / twitter_scrape.php
Last active October 22, 2018 16:12
Update to Twitter Analytics Scraper
<?php
// You can set a custom user agent if you like, this one is for Firefox 60
$user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Firefox/60.0';
// Username and password
$username = "";
$password = "";
// Set the start and end time, and add 3 zeroes, since Twitter measures in microseconds
$start = mktime( 0, 0, 0, 6, 19, 2018 ).'000';