Skip to content

Instantly share code, notes, and snippets.

//-----------------------------------
// Authenticate and Connect to OAuth Service
// Created By: Russ Savage
// FreeAdWordsScripts.com
//-----------------------------------
function main() {
//Define the Twitter Keys and Secrets
//More info on obtaining these can be found at https://dev.twitter.com/docs/auth/tokens-devtwittercom
var oauth_key_stuff = {
"consumer_key" : "your consumer key",
/**
* This script exclude low performance Display placements with more than 1000 impressions AND no clicks AND no view through conversions AND no conversions
* (you can edit these values on the top level variables).
* If one of the placements detected is anonymous.google, the script doesn't exclude it
* Script saves all detected placements in a spreadsheet
* If the script execution is interrupted, it saves the last account executed and will start from that account at the next execution
*
* @author Alberto Esteves
* URL: http://www.albertoestevescorreia.com/adwords-script-eliminar-ubicaciones-display-bajo-rendimiento/
*
/**
* This MCC level script removes Display placements with Super High CTR AND no view through conversions AND no conversions
* (you can edit these values on the top level variables).
* If one of the placements detected is anonymous.google, the script doesn't exclude it
* The script saves all detected placements in a spreadsheet
* If the script execution is interrupted, it saves the last account executed and will start from that account at the next execution
*
* @author Alberto Esteves
* URL: http://www.albertoestevescorreia.com/adwords-script-eliminar-ubicaciones-display-spam/
*
@jrosell
jrosell / gist:c275501cbec4c2e2cfdf16bb755d6273
Created May 29, 2018 20:18 — forked from winterbe/gist:5958387
Reading the Body Text of a javax.mail.Message
private boolean textIsHtml = false;
/**
* Return the primary text content of the message.
*/
private String getText(Part p) throws MessagingException, IOException {
if (p.isMimeType("text/*")) {
String s = (String)p.getContent();
textIsHtml = p.isMimeType("text/html");
<script>
element = document.querySelector('meta[name="robots"]');
if(element!=null){element.parentNode.removeChild(element);}
container = document.getElementsByTagName('head')[0];
newElement = document.createElement('meta');
newElement.setAttribute('name', 'robots');
newElement.setAttribute('content', 'noindex');
container.appendChild(newElement);
</script>
@jrosell
jrosell / Google-Related-Keywords-Extractor.js
Created September 20, 2019 12:28
Google Related Keywords Extractor
@jrosell
jrosell / mailchimp-campaigns.gs
Created October 15, 2019 08:36
Once you've created a Google Spreadsheet with "List Growth" and "Campaign Analysis" sheets, add this script filling your mailchimp API_KEY and LIST_ID
/********************************************************************************
*
* Mailchimp API - Get Campaign Data into Google Sheets
* By Ben Collins 2017
* http://www.benlcollins.com/
*
*/
var API_KEY = 'MAILCHIMP_API_KEY';
var LIST_ID = 'MAILCHIMP_LIST_ID';
@jrosell
jrosell / edit-any-website.bookmark
Last active October 20, 2019 20:19
1. Highlight the text 2. Drag the highlighted text into your bookmarks bar. 3. Click the icon whenever you want to edit any web page.
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0
/* Create helper using google/data-layer-helper from browser console */
var script = document.createElement("script");
script.type = "text/javascript";
script.text = "(function(){var g=\/\\[object (Boolean|Number|String|Function|Array|Date|RegExp)\\]\/;function h(a){return null==a?String(a):(a=g.exec(Object.prototype.toString.call(Object(a))))?a[1].toLowerCase():\"object\"}function k(a,b){return Object.prototype.hasOwnProperty.call(Object(a),b)}function m(a){if(!a||\"object\"!=h(a)||a.nodeType||a==a.window)return!1;try{if(a.constructor&&!k(a,\"constructor\")&&!k(a.constructor.prototype,\"isPrototypeOf\"))return!1}catch(b){return!1}for(var c in a);return void 0===c||k(a,c)};function n(a,b,c){this.b=a;this.f=b||function(){};this.d=!1;this.a={};this.c=[];this.e=p(this);r(this,a,!c);var d=a.push,e=this;a.push=function(){var b=[].slice.call(arguments,0),c=d.apply(a,b);r(e,b);return c}}window.DataLayerHelper=n;n.prototype.get=function(a){var b=this.a;a=a.split(\".\");for(var c=0;c<a.length;c++){if(void 0===b[a
@jrosell
jrosell / coronavirus-italy-spain-coronavirus.R
Created March 12, 2020 10:35
Brote coranovirus Italia vs España 2020. Modificación de desarrollo inicial @cjgb, que compartió código y datos en https://www.datanalytics.com/2020/03/09/seguimiento-del-coronavirus-en-tiempo-real-con-r/
cran_packages <- c("reshape2","ggplot2")
if (length(setdiff(cran_packages, rownames(installed.packages()))) > 0) {
install.packages(setdiff(cran_packages, rownames(installed.packages())), dependencies=TRUE, repos='http://cran.rstudio.com/')
}
library(reshape2)
library(ggplot2)
primer_brote <- "2020-02-14"
brote_dif <- 9