Skip to content

Instantly share code, notes, and snippets.

View son0fhobs's full-sized avatar

David son0fhobs

View GitHub Profile
@son0fhobs
son0fhobs / SERPs-scrap-SEO-Quake-Data
Last active August 29, 2015 13:57
Scrape SEO Quake Results, convert to JSON
/* THIS NEEDS TO BE MODIFIED TO ACTUALLY RUN IN SERPS */
/*
// It requires seoquake extension to be ready, and it still needs to import jquery in no conflict to work. This is for testing currently.
*/
// appending 2 csv - split(/\r\n/), loop through arrays adding lines, then join('\r\n');
var seo_quake_val = '"Url";"Google pagerank";"Google index";"SEMrush links";"SEMrush linkdomain";"Bing index";"Alexa rank";"Webarchive age";"Whois";"Page source";"SEMrush Rank"\r\n"http://www.fourthchurch.org/";"4";"4,130";"385";"938";"n/a";"1687507";"December 1, 1998";"whois";"source";"n/a"\r\n"http://www.chicagopresbytery.org/church-list/";"2";"4,020";"1";"442";"n/a";"n/a";"October 13, 1999";"whois";"source";"n/a"\r\n"http://www.chicagopresbytery.org/";"4";"4,020";"308";"442";"n/a";"n/a";"October 13, 1999";"whois";"source";"n/a"\r\n"http://www.covenantchicago.org/";"3";"57";"147";"158";"n/a";"n/a";"April 29, 2001";"whois";"source";"n/a"\r\n"http://en.wikipedia.org/wiki/Fourth_Presbyterian_Church_(Chicago)";"0"
@son0fhobs
son0fhobs / load-jQuery-in-Google-Serps-Mozbar-Scraping
Last active August 29, 2015 13:57
Load jQuery in Google SERPs & Mozbar Scraping
// *** Selector - instead find moz iframe, then .closest('li') for more reliability
// *** Work with Oop Version and Test Driven Development
/*
Default save
@son0fhobs
son0fhobs / useless-Moz-API-Bookmarklet
Last active August 29, 2015 13:57
Use serp scrape instead - Moz Free API in Serps
/* Still a work in progress */
// Never mind $('#search iframe').src has all the vals I need Gah!!!
// Snap. Make the call to my own server, passing in all the necessary serp info, then the php request to Moz.
// even/odd, classes, filters
var args = {
tableId:'',
firstRowHeaders:false,
}
function generate_html_table(data, args){
if(data === 'undefined' || !data || !data[0]){
return 'No Vals set. Ensure it's array or array of objects, or json string';
@son0fhobs
son0fhobs / serps-compare-title-and-search-term
Last active August 29, 2015 13:57
SERPs - Rating title by search term match
// stop words listed at end
// parse, then filter out empty ones. Remove apostrphes both from stop words and search term
// Value based on if term exists and how close it is to the beginning, based on linear weight.
var search_term = 'seo serp bookmarklet';
var serp_title = 'my seo serp bookmarklet for title value';
// remove stop words
search_term = remove_stop_words(search_term);
@son0fhobs
son0fhobs / html-table-data-visualization
Last active August 29, 2015 13:57
HTML Table Data Visualization
/*
// Tabelizer for Contract Table? - http://www.jqueryrain.com/?pl_6d8jV
// CSS flow! - Snippets - http://www.cssflow.com/snippets/
// better wordcloud - https://github.com/lucaong/jQCloud
// navigation and options styles awesomeness - codepen
@son0fhobs
son0fhobs / Serp2CsvOop.js
Created April 5, 2014 04:43
Serps to CSV - Oop
// Use this to learn Test Driven Development
// Also read up on best practices for Oop Javascript.
// private and public vars and methods: http://phrogz.net/JS/classes/OOPinJS.html
// how prefix it? ss // serp scrape? // mqc moz quake csv
function serpToCsv(options){
// Private Properties
@son0fhobs
son0fhobs / putlocker.is
Last active August 29, 2015 14:12
putlocker.is bookmarklet
// more thorough explanation and version to share: http://jsfiddle.net/ydj56zy3/5/
/*
// variable selector for grabbing ads, extra iframes?
// prompt for selector. Button to add back all elements and try again?
// if nothing else, color background black.
// find table elements as well.
Bookmarklet:
@son0fhobs
son0fhobs / save_plugin_states
Last active August 29, 2015 14:14
Save active wordpress plugin - When deactivating for troubleshooting
/* Find the active plugins, save to array */
$=jQuery;
plugin_states = [];
$('.row-actions-visible').each(function(i){
// save state which is set as class "activate" or "deactivate"
plugin_state_class = $(this).children().eq(0).attr('class');
plugin_states.push(plugin_state_class);
});
@son0fhobs
son0fhobs / html_tables.class.php
Last active August 29, 2015 14:20
HTML Table Generator
<?php
/*
Advantages
Add data in any format. Associative, numberic, multiple rows, single rows, etc
Allows to add data and display in two methods.
Flexibility, extensibility. Any attrs, rows, cells, table, even/odd, etc
Filter rows for flexibility in attrs (row thirds, etc), as well as filter data and attrs based on data