Skip to content

Instantly share code, notes, and snippets.

function initTwitterFollowerCount() {
insertTwitterFollowerCount("IG followers", "nickboyce");
}
function insertTwitterFollowerCount(sheetName, username) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheetName);
Logger.log(sheet.getRange("A1").getValue());
sheet.appendRow([Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd"), getTwitterFollowerCount(username)]); 
}
function initFollowerCount() {
// sets up sheet names and Instagram accounts
insertFollowerCount("sheet1", "kingandmcgaw");
insertFollowerCount("sheet2", "nickboyce");
}
function insertFollowerCount(sheetName, instagramAccountName) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheetName);
sheet.appendRow([Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd"), getInstagramFollowerCount(instagramAccountName)]);
@nickboyce
nickboyce / instagram_count_to_googe_sheet.js
Last active February 14, 2024 05:15
Track your Instagram followers over time with Google Sheets Scripts
// Thank you to @juliendev for his script (updated here with minor cosmetic changes)
// https://gist.github.com/JulienDev/df5a3b66e899c224fa1b2dc90acfa2ae
// Your sheet name in the document
var sheetName = "Sheet1";
// Your instagram user id
var user_id = ""; //find your id here : https://codeofaninja.com/tools/find-instagram-user-id
var instagram_base_url = "https://www.instagram.com/graphql/query/";
var following = "?query_hash=58712303d941c6855d4e888c5f0cd22f&variables=%7B%22id%22%3A%22" + user_id + "%22%2C%22first%22%3A24%7D"
order:
app_key: "en_easyart"
request_ip_address: "192.168.0.1"
status: "ok"
customer_name: "John Citizen"
customer_email: "john@citizen.com"
shipping_address:
name: "John Citizen"
street1: "Unit 123"
street2: "456 Fake Street"
describe "hasMailChimpParams", ->
it "should return true if MailChimp parameters are in the URL", ->
hasMailChimpParams = EA.MailchimpData.checkForMailChimpParams("http://www.easyart.com?mc_cid=true&mc_eid=true");
expect(hasMailChimpParams).toBeTruthy();
it "should not return true if MailChimp parameters are not in the URL", ->
hasMailChimpParams = EA.MailchimpData.checkForMailChimpParams("http://www.easyart.com");
expect(hasMailChimpParams).not.toBeTruthy();
module ActiveSupport
module Cache
class IronCache < ActiveSupport::Cache::Store
def escape_key(key)
ekey = ::Base64.encode64(key).gsub("\n",'').gsub("/",'')
if ekey.size > 250
ekey = "#{ekey[0, 213]}:md5:#{Digest::MD5.hexdigest(ekey)}"
end
require 'msgpack'
require 'json'
require 'benchmark'
o = {_id: 4086, created_at: "2002-12-01 00:00:00 UTC", updated_at: "2013-05-16 11:35:46 UTC", artist_id: "5165adb400e48fcc14000001", easyart_id: 4086, title: "The Tree of Life - Stoclet Frieze", tags: ["woman", "hug", "bedroom", "lounge"], available_media: ["paper", "canvas"], available_sizes: [], dominant_colour: [], original_medium: "Pencil / Ink / Pastel", artistic_movement: "Art Nouveau", shape: "landscape", supplier_id: "114", lead_time: 10, stock_level: 2, sales_per_day: 0.017771883289125, total_revenue: 285195, is_pod: false, category: [["figurative", "romance"], ["museum-art", "art-nouveau"]], category_slugs: [], edition_size: 0, price: 5499, original_price: nil, discount_percent: 0, status_id: nil, search_promotion: 0, copyright: nil, description: nil, height: nil, width: nil, easyart_ids: [], dominant_colours: ["gold"]}
a = []
100000.times do
a << o
end
@nickboyce
nickboyce / gist:5188171
Last active December 15, 2015 02:38
Initial discovery of Casper/PhantomJS
// brew install phantomjs
// brew install casperjs
var casper = require("casper").create();
casper.start("http://www.easyart.com/scripts/pod/pod.pl?pid=213288", function() {});
casper.then(function() {
this.test.assertEval(function() {
return document.querySelectorAll("#pod-size-options input[type=radio]").length == 4
@nickboyce
nickboyce / gist:3137425
Created July 18, 2012 16:53
Dumped template variables
searchsession: The_Kiss1%2C2%2C3%2C4%2C7%2C8
num_results_per_page: 36
num_results_per_page_36: 1
params_as_hidden_form_fields:
current_page: 1
total_pages: 395
page_links: 12345678910Next
template_state_1: 1
total_results: 14191
COOKIES.hideBanner: true
{
"paging": {
"total": 95959,
"current_page": 1,
"total_pages": 9596,
"per_page": 10,
"previous_page_uri": null,
"next_page_uri": "/artworks.json?page=2&per_page=10"
},
"results": [