Skip to content

Instantly share code, notes, and snippets.

<?php
//clearly client_id should = something other than XXXXXXXXXXXXXXXXXXXXXXX
$search = 'ecig';
$url = 'https://api.instagram.com/v1/tags/' . $search .'/media/recent?client_id=XXXXXXXXXXXXXXXXXXXXXXX';
$json = file_get_contents($url);
$obj = json_decode($json);
date_default_timezone_set('EST');
$list = array();
foreach ($obj->data as $media) {
@woodwardtw
woodwardtw / google spreadsheet instagram grabber
Created September 16, 2015 01:09
Not looping but grabs 40 rather than 20 instagram items
function addTitles() {
var sheet = SpreadsheetApp.getActiveSheet();
// sets up the header row for the sheet
sheet.appendRow(['User Name', 'Likes Count', 'Comment Count', 'URL', 'Caption', 'Filter', 'Created Time']);
}
// attempt to loop to get next_url
@woodwardtw
woodwardtw / Gsheets_Angular_POC.html
Created October 6, 2015 15:00
Parsing Google Sheets JSON in Angular
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tools and Tips for 1:1</title>
<meta name="generator" content="BBEdit 11.1" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<?php
/*
Plugin Name: URL counter
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: This describes my plugin in a short sentence
Version: 1.5
Author: Tom Woodward
Author URI: http://bionicteaching.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@woodwardtw
woodwardtw / postmeta.html
Created October 19, 2015 15:59
Interactive page to see and mess with the data from the URL counter plugin https://gist.github.com/woodwardtw/81433e2d12596ebf4e75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Embed All the Things</title>
<!-- CSS bar graph from http://geoffgraham.me/css-bar-chart-using-html5-progress/ -->
<meta name="generator" content="BBEdit 11.1" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script type="text/javascript" src="https://code.angularjs.org/1.2.0-rc.3/angular-sanitize.js"></script>
@woodwardtw
woodwardtw / gform_to_calendar_script.js
Last active January 28, 2017 04:00
google script to make g calendar entries from google form submissions
//adapted from https://www.considerednormal.com/2014/04/adding-a-google-calendar-event-using-google-forms/
//this is the ID of the calendar where you want the event to show up, this is found on the calendar settings page of the calendar in question
var calendarId = "YOUR_SECRET_CALENDAR_ID_GOES_HERE";
//below are the column ids that represents the values used in the spreadsheet (these start with 1 rather than 0 like on some things)
//start date - make sure you also check the time box in the Google form (that's new- at least to me)
var startDtId = 5;
//end date - make sure you check the time box in the Google form
var endDtId = 7;
@woodwardtw
woodwardtw / facebook comment expander bookmarklet
Last active November 8, 2019 12:29
This bookmarklet opens up FB comments via http://www.alecjacobson.com/weblog/?p=4074 and http://mikakesensei.com/perso/javascript/fb_expander.js - Just make a new bookmark and cut/paste this into the URL field.
javascript: var cur_arr = [];
function what_to_click() {
if (cur_arr.length) {
return cur_arr.pop();
} else {
cur_arr = [].slice.call(document.getElementsByClassName("UFIPagerLink"));
if (cur_arr.length) {
return cur_arr.pop();
} else {
/* modified from @hubgit and http://stackoverflow.com/questions/30328636/google-apps-script-count-files-in-folder
for this stackexchange question http://webapps.stackexchange.com/questions/86081/insert-image-from-google-drive-into-google-sheets by @twoodwar
*/
function listFilesInFolder(folderName) {
//writes the headers for the spreadsheet
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Name", "Date", "Size", "URL", "Download", "Description", "Image"]);
var folderId = "YOUR_FOLDER_ID_GOES_HERE";
var folder = DriveApp.getFolderById(folderId);
<?php
/**
* Plugin Name: PressThis Simple Button
* Plugin URI: https://notyet.com
* Description: This plugin adds a big button that says write and links to the simple Press This editor.
* Version: .007
* Author: Tom Woodward
* Author URI: http://bionicteaching.com
* License: GPL2
*/
/*
Welcome to Custom CSS!
To learn how this works, see http://wp.me/PEmnE-Bt
*/
.highlight {
padding: 2px 4px;
font-size: 90%;
color: #3a87ad;
background-color: #D9EDF7;