Skip to content

Instantly share code, notes, and snippets.

View russorat's full-sized avatar
👋

Russ Savage russorat

👋
View GitHub Profile
/***********
* This is the function that will run in each account. We
* can leverage all the functions we wrote earlier to make
* this as short as possible.
***********/
function findKeywordsToDelete(optionalInput) {
// We are sending over a set of configs from the main
// function. Parse that config, check to see if there is
// an override for this account, or use the default.
var all_configs = JSON.parse(optionalInput);
/***********
* Collects the reporting results from all accounts
* and generates a nicely formatted email. If there
* are errors for an account, it includes those
* in the email as well since an error in one account
* won't stop the entire script.
***********/
function generateReport(results) {
var NOTIFY = ['your_email@example.com'];
var total_deleted = 0;
/***********
* This function verifies that the keywords already in limbo
* but are no longer a dud have the labels removed as needed.
**********/
function checkForRedemption(duds,changes_to_make) {
// An array works well for selectors, but
// it will be much easier to do lookups here if
// we transform the duds array into a map.
var dudsMap = {};
for(var i in duds) {
@russorat
russorat / keyword_cleanup_full.js
Last active July 27, 2019 20:23
The full Keyword Cleanup Script from my SearchEngineLand.com post. Be sure to change the email on line 30. See the blog post for more details.
function main() {
var config_options = {
'default' : {
metric : 'Conversions', // This metric will be used for determining duds
threshold : 0, // Duds are less than or equal to this threshold
days_ago : 90, // The timeframe of the data to consider, days ago to yesterday
days_in_limbo : 5 // The script will warn you for this many days before deleting something
}
// If you want, you can add account specific configurations too. If an account specific config
// is not found, the default one from above is used.
@russorat
russorat / arris-scraper.py
Created February 20, 2020 17:18
modified version of arris-scraper.py that writes data into InfluxDB 2.0.
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
'''arris-scraper.py (c) 2019 Matthew J Ernisse <matt@going-flying.com>
All Rights Reserved.
Load the status page from an Arris/Motorola SB8200 modem, parses the
status page and loads the values into an InfluxDB database.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@russorat
russorat / install_ngrok.md
Last active April 19, 2024 19:58 — forked from SalahHamza/install_ngrok.md
How to install ngrok on linux subsystem for windows