Saber que números tienen whatsapp

Buenas noches SQLeros espero este año nuevo tengan la dicha de realizar todas sus metas y hacer lo que les guste.

El día de hoy les comparto rápidamente un script en Python para saber los números que tienen whatsapp en su localidad.

El código es el siguiente:




Python 2.x

import urllib
import urllib2
import random
import time
url = "https://sro.whatsapp.net/client/iphone/iq.php"
post_data_dictionary = {"cd":"1", "cc":"52","me":"","u":""}
for x in range(2291010000,2291010500):
    post_data_dictionary["me"] = x
    print "Consultando Numero: %s" % (x)
    #sets the user agent header
    http_headers = {"User-Agent":"Mozilla/4.0 (compatible; MSIE 5.5;Windows NT)"}

    post_data_encoded = urllib.urlencode(post_data_dictionary)
    request_object = urllib2.Request(url, post_data_encoded, http_headers)

    response = urllib2.urlopen(request_object)
    html_string = response.read()
    if(html_string.find("<dict>")>0):
        print "%s Tiene WhatsApp" % (x)
        try:
            # This will create a new file or **overwrite an existing file**.
            f = open("whatsappNumbers.txt", "w")
            try:
                f.write("%s\n" % (x)) # Write a string to a file
            finally:
                f.close()
        except IOError:
            pass
    await = random.randrange(1,5)
    print "await %s seconds..." % (await)
    time.sleep(await)


Para Python 3.x

import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import random
import time
url = "https://sro.whatsapp.net/client/iphone/iq.php"
post_data_dictionary = {"cd":"1", "cc":"52","me":"","u":""}
for x in range(2351000239,2351010001):
    post_data_dictionary["me"] = x
    print("Consultando Numero: %s" % (x))
    #sets the user agent header
    http_headers = {"User-Agent":"Mozilla/4.0 (compatible; MSIE 5.5;Windows NT)"}

    post_data_encoded = urllib.parse.urlencode(post_data_dictionary)
    binary_data = post_data_encoded.encode("utf-8") 
    request_object = urllib.request.Request(url, binary_data, http_headers)

    response = urllib.request.urlopen(request_object)    
    html_string = response.read()
    if(html_string.decode().find("<dict>")>0):
        print("%s Tiene WhatsApp" % (x))
        try:
            # This will create a new file or **overwrite an existing file**.
            f = open("whatsappNumbers.txt", "a")
            try:
                f.write("%s\n" % (x)) # Write a string to a file
            finally:
                f.close()
        except IOError:
            pass
    #await = random.randrange(1,5)
    #print("await %s seconds..." % (await))
    #time.sleep(await)


¡Listo! Ya es cosa de que se pongan a jugar con los números y ver combinaciones... Como tip a los 5000 números el server de WA te bloquea... :3

¡Saludos y Feliz año 2013!

2 comentarios:

  1. no funciona la url https://sro.whatsapp.net/client/iphone/iq.php teneis idea de que ha podido pasar? han cambiado la url?

    ResponderEliminar
  2. Creo que ya no esta disponible esa dirección. Lastima porque era una forma divertida de obtener datos. :(

    ResponderEliminar