Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@judotens
judotens / clean.sh
Last active August 29, 2015 14:02
Botnet .IptabLes & .IptabLex cleaner
# botnet .IptabLes & .IptabLex cleaner
# tested on my ec2 based on Amazon AMI
# here i attached my version -> http://filebin.ca/1PPeWObrq63q/IptabLesx.zip
# https://malwr.com/analysis/MDIyMmEzZmU1ZjIzNGU4ZGIxNTQ1NmViNmYxNjc0NTQ/
# @judotens
# 1.1M
getsetup_sum="27fff3d371fff67bf14cb91e7b1f6623"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" """
import json
from urllib2 import urlopen
from lxml.html import document_fromstring
from lxml.cssselect import CSSSelector as cs
@judotens
judotens / ubigram.sh
Last active December 29, 2015 01:49
Find top unigram & bigram using bash
#!/bin/bash
# cat artikel.txt | ./ubigram.sh
# results sorted by frequences
# freq, keyword
cat "$@" |
tr -cs "a-zA-Z0-9" '\012' | tr '[:upper:]' '[:lower:]' |
{
old="aaa."
@judotens
judotens / acak.sh
Last active December 29, 2015 01:49
Randomize the input lines using bash
#!/bin/bash
# randomize the input lines
# cat artikel.txt | ./acak.sh
awk 'BEGIN{srand() }
{ lines[++d]=$0 }
END{
while (1){
if (e==d) {break}
@judotens
judotens / cari.c
Last active December 29, 2015 16:29
Find an insensitive string in big text file. faster than cat and grep. supports multiple keywords, separated by space. no regex support.
/* cari string di file, case insensitive
support multiple keyword, tapi bukan regex. diisah by spasi aja
find an insensitive string in big raw text. faster than cat and grep.
supports multiple keywords, separated by space. no regex support.
@judotens
./cari bigfile.txt keyword
@judotens
judotens / tanyasimi.py
Last active December 29, 2015 17:09
SimSimi CLI chat
# url sniffed frm mitmproxy
# ref: http://blog.philippheckel.com/2013/07/01/how-to-use-mitmproxy-to-read-and-modify-https-traffic-of-your-phone/
import sys, urllib, urllib2, json, random
def tanya_simi(teks):
acak = str(int(random.uniform(100000,300000)))
data = {'av': 5.2, 'ft': 1.0, 'lc': 'id', 'os': 'i', 'req': teks, 'tz': "Asia/Jakarta", 'uid': acak}
url = "http://app.simsimi.com/app/aicr/request.p?" + urllib.urlencode(data)
@judotens
judotens / topsy_search.py
Created November 29, 2013 08:11
Topsy search scraper
# scrape tweets from topsy.com
import sys, urllib, urllib2, json, random
def search(query):
data = {'q': query, 'type': 'tweet', 'offset': 1, 'perpage': 1000, 'window': 'a', 'sort_method': "-date", 'apikey': '09C43A9B270A470B8EB8F2946A9369F3'}
url = "http://otter.topsy.com/search.js?" + urllib.urlencode(data)
data = urllib2.urlopen(url)
o = json.loads(data.read())
res = o['response']

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA