Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:
<3

Pierrick bKNN

:atom:
<3
View GitHub Profile
@bKNN
bKNN / medium-50claps.js
Created Jan 10, 2020
SCRIPT - Medium 50 claps
View medium-50claps.js
javascript:(()=>{const a=new MouseEvent("mouseup",{bubbles:!0}),b=new MouseEvent("mousedown",{bubbles:!0}),c=document.querySelector(`.js-postActionsFooter button[data-action="multivote"]`);let d=0;const e=window.setInterval(()=>{const f=document.querySelector(".js-floatingMultirecommendCount"),g=parseInt(f&&f.textContent||-1,10);(50===g||100<d)&&(c.dispatchEvent(a),window.clearInterval(e)),d++},500);c.dispatchEvent(b)})();
@bKNN
bKNN / status-code.py
Created Dec 18, 2019
DATAVIZ - status code
View status-code.py
import matplotlib.pyplot as plt
labels = '404', '200', '301'
sizes = [6, 891, 885]
explode = (0, 0.1, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=180, colors=('pink','lightgreen','lightblue'))
ax1.axis('equal')
plt.show()
@bKNN
bKNN / ressources.py
Created Dec 18, 2019
DATAVIZ - Ressources type
View ressources.py
import matplotlib.pyplot as plt
labels = 'HTML', 'CSS', 'JS', 'Images','Autres'
sizes = [9, 13, 31, 48, 17]
explode = (0, 0, 0, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=180, colors=('pink','lightgreen','lightblue','lightgrey','purple'))
ax1.axis('equal')
plt.title("Nombre de requêtes par types de ressources")
plt.show()
@bKNN
bKNN / pages-utiles.py
Created Dec 18, 2019
DATAVIZ - Venn diagram for usefull/helpfull pages
View pages-utiles.py
from matplotlib import pyplot as plt
import numpy as np
from matplotlib_venn import venn3, venn3_circles
plt.figure(figsize=(12,12))
plt.title("Pages Actives et Inactives")
v = venn3(subsets=(251, 8, 49, 1,226,3,634), set_labels = ('URL trouvées au crawl', 'URL trouvées dans les sitemaps', 'URL trouvées dans GA + GSC'))
c=venn3_circles(subsets = (251, 8, 49, 1,226,3,634), linestyle='dashed', linewidth=1, color="grey")
plt.show()
@bKNN
bKNN / robots.txt for Wordpress
Last active Oct 25, 2019
robots.txt boilerplate for Wordpress
View robots.txt for Wordpress
User-agent: *
Disallow: /wp-admin/
Disallow: /cgi-bin/
Disallow: /trackback/
Disallow: /comment-page-*
Disallow: /?s=*
Disallow: /*.php$
Allow: /wp-admin/admin-ajax.php
@bKNN
bKNN / serp-extractor-v2.js
Last active May 20, 2020
BOOKMARKLET - Extracteur SERP
View serp-extractor-v2.js
javascript:(function(){output='<html><head><title>SEO SERP Extraction</title><style type=\'text/css\'>body,table{font-family:Tahoma,Verdana,Segoe,sans-serif;font-size:11px;color:#000}h1,h2,th{color:#3700ff}th{text-align:left}h2{font-size:11px;margin-bottom:3px}</style></head><body>'; output+='<table><tbody><tr><td><a href=\'https://pierrick.dev\'><img src=\'https://pierrick.dev/uploads/0.png\'></a></td><td><h1>SEO SERP Extraction Tool</h1></td></tr></tbody></table>'; pageAnchors=document.getElementsByTagName('a'); divClasses=document.getElementsByTagName('div'); var linkcount=0;var linkLocation=''; var linkAnchorText=''; output+='<table><th>ID</th><th>Link</th><th>Anchor</th>'; for(i=0;i<pageAnchors.length;i++){ if(pageAnchors[i].parentNode.parentNode.getAttribute('class')!='iUh30'){ var anchorText = pageAnchors[i].textContent; var anchorLink = pageAnchors[i].href; var linkAnchor = anchorLink + '\t'+anchorText; var anchorID = pageAnchors[i].id; if(anchorLink!=''){ if(anchorLink.match(/^((?!google\.|cache|blog
@bKNN
bKNN / queries.js
Created Apr 23, 2019
BOOKMARKLET - Trouver des URLs a desindexer de Google
View queries.js
javascript:window.open('https://www.google.com/search?q=site%3A%27+window.location.hostname
+%27 inurl:demo OR inurl:/home/ OR inurl:test OR inurl:-2 OR inurl:screenshot OR inurl:sample OR inurl:portfolio OR inurl:landing');
@bKNN
bKNN / logs_GoogleBot_extract.pl
Last active Dec 19, 2018
Extraction des logs GoogleBot
View logs_GoogleBot_extract.pl
#!/usr/bin/perl
use Socket;
sub googlebot($) {
# vérifiez si cette adresse IP est vraiment un Googlebot
my $ip = shift;
my $bot = 'googlebot\.com';
my $name = gethostbyaddr(inet_aton($ip), AF_INET) or return 0;
View https_redirection_ht_access
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
View www_redirect_ht_access
RewriteCond% {HTTP_HOST} *! ^ Www * .example.com [NC] RewriteRule (. *) Http://www.example.org/$1 [L, R = 301]