This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(){for(var kwds=$$("._GApu"),clicks=$$("._GAtjb"),impresiones=$$("._GAtjb"),ctr=$$("._GAtjb"),total=kwds.length,content="",i=0;i<total;i++)content+="<li>"+kwds[i].innerHTML+"</li>";with(output="<html><head><title>Punto Rojo Tools - Google Analytics Keyword Extractor</title><style type='text/css'>body,table{font-family: 'Open Sans', sans-serif;font-size:11px;color:#000}h1,h2,th{color:#405850}th{text-align:left}h2{font-size:11px;margin-bottom:3px}</style></head><body>",output='<img src="https://puntorojo.agency/wp-content/themes/punto_rojo/img/logo_mini.png" width="200px"><br><h1>Google Analytics Keyword Extractor</h1><br>',output+='<table colpadding="10">',output+=content,output+="</table></body></html>",window.open())document.write(output),document.close()}(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(var kwds=document.getElementsByClassName("_GApu"),clicks=document.getElementsByClassName("_GAtjb"),total=kwds.length,content='<table align="center"><tr><th>Keywords</th><th>Clicks</th><th>Impresiones</th><th>CTR</th><th>Ranking</th></tr>',i=0;i<total;i++){var current_kwd=kwds[i].innerHTML,current_clicks=clicks[i].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_impresiones=clicks[i+1].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_ctr=clicks[i+2].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_posicion_media=clicks[i+3].innerText.split("(")[0].replace("%","").replace(".","").trim();i+=3;var row="<td>"+current_kwd+'</td><td align="center">'+current_clicks+'</td><td align="center">'+current_impresiones+'</td><td align="center">'+current_ctr+'</td><td align="center">'+current_posicion_media+"</td>";content+="<tr style=\"font-family: 'Open Sans'\">"+row+"</tr>"}with(output='<html><head><title>Punto Rojo Tools - Google Analytics Keyword Extra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slug(input) { | |
input = input.toLowerCase(); | |
input = input.replace(/\s+/g, "-"); | |
input = input.replace(/[&\/\\#,+()$~%.'":*¿?¡!<>{}]/g, ''); | |
return input; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return the time that the referenced cell or range was last changed. | |
* Initial use shows current time. | |
* | |
* @param {"keyword"} term La keyword a analizar | |
* @param {"texto"} flow El texto que contiene la keyword | |
* @param {"corpus"} document Todos los textos de tu sitio | |
* @param {"verbose"} verbose VERDADERO o FALSO: muestra un detalle del análisis | |
* @customfunction | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function categorizar(slug) { | |
//Escribí un array para cada categoría y llenalo de keywords | |
var keywords_tutoriales = [ | |
"tutorial", "how-to", "guide", "step-by-step", | |
]; | |
var keywords_links = [ | |
"link", "anchor", | |
]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stopwords = [ | |
'about', 'after', 'all', 'also', 'am', 'an', 'and', 'another', 'any', 'are', 'as', 'at', 'be', | |
'because', 'been', 'before', 'being', 'between', 'both', 'but', 'by', 'came', 'can', | |
'come', 'could', 'did', 'do', 'each', 'for', 'from', 'get', 'got', 'has', 'had', | |
'he', 'have', 'her', 'here', 'him', 'himself', 'his', 'how', 'if', 'in', 'into', | |
'is', 'it', 'like', 'make', 'many', 'me', 'might', 'more', 'most', 'much', 'must', | |
'my', 'never', 'now', 'of', 'on', 'only', 'or', 'other', 'our', 'out', 'over', | |
'said', 'same', 'see', 'should', 'since', 'some', 'still', 'such', 'take', 'than', | |
'that', 'the', 'their', 'them', 'then', 'there', 'these', 'they', 'this', 'those', | |
'through', 'to', 'too', 'under', 'up', 'very', 'was', 'way', 'we', 'well', 'were', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
keywords = ['keyword 1', 'keyword 2', 'keyword 3'] #poné tus keywords acá | |
rank_limit = 30 #Cantidad de posiciones a analizar | |
#No hace falta modificar las siguientes líneas | |
df = pd.read_csv('data.csv') | |
df['Date'] = pd.to_datetime(df['Date'], format='%Y%m%d') | |
df = df[df['Query'].isin(keywords)].sort_values(by=['Date']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stopwords = ['algún', 'alguna', 'algunas', 'alguno', 'algunos', 'ambos', 'ampleamos', 'ante', 'antes', 'aquel', 'aquellas', 'aquellos', 'aqui', 'arriba', 'atras', 'bajo', 'bastante', 'bien', 'cada', 'cierta', 'ciertas', 'cierto', 'ciertos', 'como', 'con', 'conseguimos', 'conseguir', 'consigo', 'consigue', 'consiguen', 'consigues', 'cual', 'cuando', 'dentro', 'desde', 'donde', 'dos', 'el', 'ellas', 'ellos', 'empleais', 'emplean', 'emplear', 'empleas', 'empleo', 'en', 'encima', 'entonces', 'entre', 'era', 'eramos', 'eran', 'eras', 'eres', 'es', 'esta', 'estaba', 'estado', 'estais', 'estamos', 'estan', 'estoy', 'fin', 'fue', 'fueron', 'fui', 'fuimos', 'gueno', 'ha', 'hace', 'haceis', 'hacemos', 'hacen', 'hacer', 'haces', 'hago', 'incluso', 'intenta', 'intentais', 'intentamos', 'intentan', 'intentar', 'intentas', 'intento', 'ir', 'la', 'largo', 'las', 'lo', 'los', 'mientras', 'mio', 'modo', 'muchos', 'muy', 'nos', 'nosotros', 'otro', 'para', 'pero', 'podeis', 'podemos', 'poder', 'podria', 'podriais', 'podriam |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyword = $('input[name$="q"]').value | |
var results = $$('div[class="r"]'); | |
var date = new Date().toISOString().split('T')[0]; | |
var content = ''; | |
for (var i = 0; i < results.length; i++){ | |
var rank = i+1; | |
var current_url = results[i].innerHTML.match(/<a href="([^"]*)/)[1]; | |
var current_title = results[i].innerHTML.match(/<h3.*?>(.*?)</)[1]; | |
content += '<tr><td>' + date + '</td><td>' + rank + '</td><td>' + keyword + '</td><td>' + current_title + '</td><td class="tdurl">' + current_url + '</td></tr>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Scrape Google SERPs for Top Stories URLs and titles | |
import requests | |
from bs4 import BeautifulSoup | |
keyword = 'keyword goes here' | |
url = 'https://www.google.com/search?q=%s' % keyword | |
source = requests.get(url).content | |
soup = BeautifulSoup(source, 'lxml') |
OlderNewer