Created
August 9, 2012 20:22
-
-
Save ederwander/3307771 to your computer and use it in GitHub Desktop.
Colsulta Operadora Celular
This file contains hidden or 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/python | |
# | |
# @version Eng Eder de Souza | |
# @package Portabilidade | |
# @copyright Copyright (C) Open Source. | |
# @license GNU/GPL | |
# # Acesso ao banco de dados fornecido por http://magnussolution.com | |
# | |
import urllib2 | |
import re | |
import sys | |
Keys = {5312 : 'CTBC CELULAR S.A', 55314 : 'BRASIL TELECOM CELULAR', 55320 : 'VIVO', 55321 : 'AMERICEL', 55323 : 'TELEMIG CELULAR', 55324 : 'AMAZONIA CELULAR', 55331: 'TNL PCS', 55337: 'UNICEL DO BRASIL', 55341: 'TIM CELULAR', 55343: 'SERCOMTEL CELULAR', 55349: 'OPTIONS COMP', 55377: 'MCS (Nextel)', 55390: 'TELCOM TELECOMUNICACOES DO BRASIL', 55391: 'FALKLAND TECNOLOGIA', 55392: 'IRIDIUM', 55393: 'GLOBALSTAR DO BRASIL'} | |
number=sys.argv[1] | |
#Put in E164 format | |
number="55" + number | |
url='http://magnussolution.com/portabilidade.php?seache_number=' | |
url = url + str(number) | |
req = urllib2.Request(url) | |
response = urllib2.urlopen(req) | |
Key = response.read(); | |
Operadora = Keys[int(Key)] | |
print Operadora |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment