Skip to content

Instantly share code, notes, and snippets.

@titomus
titomus / autofollow.js
Last active June 29, 2017 07:18
Comment récupérer des followers sur Twitter en semi automatique... grâce à Chrome
setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 5000);
__count__=0;
jQuery('.Grid-cell .not-following .follow-text').each(function (i, ele) {
ele = jQuery(ele);
if (ele.css('display')!='block') {
console.log('deja suivi:', i);
return;
} setTimeout(function () {
ele.click();
}, __count__++*500);
@titomus
titomus / GoogleSerpsExtractor.js
Last active May 18, 2017 21:03
Bookmarklet pour Scraper Les Résultats Google
javascript: (function() {
function extractHostname(url) {
var hostname;
if (url.indexOf("://") > -1) {
hostname = url.split('/')[2];
}
else {
hostname = url.split('/')[0];
}
@titomus
titomus / functions.php
Last active February 13, 2022 17:29
Comment créer une page de capture virale
<?php
/*
CONFIG
*/
$get_email = 'Email';
$get_name = 'Name';
$get_referby = 'refby';
$site_name = 'Titre';
$site_slogan = 'Slogan';
@titomus
titomus / functions.php
Created February 2, 2017 16:04
Autoriser les shortcodes dans les tags html (pour les formulaires)
<?php
#shortcode dans input form
add_filter( 'wp_kses_allowed_html', 'allow_tag_in_input', 10, 2 );
function allow_tag_in_input( $allowedposttags, $context ) {
if ( $context == 'post' ) {
$allowedposttags['input']['value'] = 1;
}
return $allowedposttags;
}
@titomus
titomus / is-bot.php
Created February 1, 2017 19:09
Detecter les bots par IP
<?php
/**
* Is_bot
* traque la présence d'un bot par plage d'ip
*
* @param string $ip
* @param array $array_bots
* @return string|false
*/
@titomus
titomus / functions.php
Last active February 1, 2017 19:11
Codes Wordpress pour monter un Silo Seo
<?php
#lier le logo en header à la catégorie
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
function child_header_title( $title, $inside, $wrap ) {
if(is_singular('post')){
$category_id = get_the_category();
$id = $category_id[0]->term_id;