| Предыдущая тема :: Следующая тема |
| Автор |
Сообщение |
Netlog
Известный нетмониторщик
Зарегистрирован: 02.02.2004
Сообщения: 468
Откуда: Ростов на Дону
Телефон: Siemens S35
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Ср, 02.09.2009 12:30 Заголовок сообщения: |
|
|
McMaster, а что собственно нужно от скрипта?
Пардон, пару дней был без инета.
Тут то уже каких только не было примеров, надёргать кусков из разных - можно собрать все мыслимые варианты.
| kazaros писал(а): | | здравствуйте) поставил себе и питон и мск, московский мегафон вытаскивают из гугла как положено, а вводил сид и лак мтс и мегафон питера...нет данных... |
Конкретные примеры приводи, а так, на словах, ничего не понятно. |
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Чт, 03.09.2009 12:43 Заголовок сообщения: |
|
|
| Netlog писал(а): | а что собственно нужно от скрипта?
Пардон, пару дней был без инета. |
нужен скриптик с прокси для скана гугла с записью в wpt, с возможностью перебора цид и лак, возможность у цид резные варианты перебора  |
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Чт, 03.09.2009 15:19 Заголовок сообщения: |
|
|
а под какую версию питона пишете? версии 2 и 3 различаются
указывайте под какую версию
вот вроде надёргал
| Код: | # -*- coding: cp1251 -*-
operatorid = 01
countrycode = 250
a = '000E00000000000000000000000000001B0000000000000000000000030000'
net = countrycode*100+operatorid
i, count_error = 0,0
import urllib2,sys,datetime
#proxy = "92.207.45.14:8080"
#proxy = "127.0.0.1:3128"
#proxy = urllib2.ProxyHandler({"http" : proxy})
#opener = urllib2.build_opener(proxy)
#urllib2.install_opener(opener)
now = datetime.datetime.now()
now_s = str(now.year).zfill(4) + "-" + str(now.month).zfill(2) + "-" + str(now.day).zfill(2) + "_" + str(now.hour).zfill(2) + "-" + str(now.minute).zfill(2) + "-" + str(now.second).zfill(2) + ".csv"
file = open(now_s,"w")
file.write('OziExplorer Waypoint File Version 1.0\nWGS 84\nReserved 2\nReserved 3\n')
for cid in range(55711,55801)[0:]:
print ('-', cid)
for lac in range(65537)[570:570]:
b = hex(cid)[2:].zfill(8) + hex(lac)[2:].zfill(8)
c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfill(8)
string = (a + b + c + 'FFFFFFFF00000000').decode('hex')
try:
data = urllib2.urlopen('http://www.google.com/glm/mmap',string)
now = datetime.datetime.now()
now_s = str(now.year).zfill(4) + "." + str(now.month).zfill(2) + "." + str(now.day).zfill(2) + " " + str(now.hour).zfill(2) + ":" + str(now.minute).zfill(2) + ":" + str(now.second).zfill(2)
r = data.read().encode('hex')
if len(r) > 14:
count_error = 0
lat = float(int(r[14:22],16))/1000000
if (lat > 360):
lat = lat - 2^32/1000000
lon = float(int(r[22:30],16))/1000000
if (lon > 360):
lon = lon - 2^32/1000000
r1 = int(r[30:38],16)
r2 = int(r[38:46],16)
print lat, lon, r1, r2
file.write('%s, %d, %d, %d, %f, %f, %d, %d\n' % (now_s, countrycode*100+operatorid, lac, cid, lat, lon, r1, r2))
file.write('%d, %d-%d, %f, %f\n' % (i, lac, cid, lat ,lon))
else:
print ('-', lac, cid, '- no data in gogle')
except:
print 'no data in google'
count_error = count_error+1
if(count_error > 20):
break
file.close() |
|
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Пт, 04.09.2009 11:32 Заголовок сообщения: |
|
|
вот скриптик, сканирует гугл с прокси
| Код: | # -*- coding: cp1251 -*-
operatorid = 02
countrycode = 250
a = '000E00000000000000000000000000001B0000000000000000000000030000'
net = countrycode*100+operatorid
i, count_error = 0,0
import urllib2,sys,datetime
proxy = "110.172.167.35:8080"
#proxy = "127.0.0.1:3128"
proxy = urllib2.ProxyHandler({"http" : proxy})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
now = datetime.datetime.now()
now_s = str(now.year).zfill(4) + "-" + str(now.month).zfill(2) + "-" + str(now.day).zfill(2) + "_" + str(now.hour).zfill(2) + "-" + str(now.minute).zfill(2) + "-" + str(now.second).zfill(2) + ".wpt"
file = open(now_s,"w")
file.write('OziExplorer Waypoint File Version 1.0\nWGS 84\nReserved 2\nReserved 3\n')
for cid in range(57091,57099)[0:]:
print ('-', cid)
for lac in range(65537)[5058:5059]:
b = hex(cid)[2:].zfill(8) + hex(lac)[2:].zfill(8)
c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfill(8)
string = (a + b + c + 'FFFFFFFF00000000').decode('hex')
try:
data = urllib2.urlopen('http://www.google.com/glm/mmap',string)
now = datetime.datetime.now()
now_s = str(now.year).zfill(4) + "." + str(now.month).zfill(2) + "." + str(now.day).zfill(2) + " " + str(now.hour).zfill(2) + ":" + str(now.minute).zfill(2) + ":" + str(now.second).zfill(2)
r = data.read().encode('hex')
if len(r) > 14:
count_error = 0
lat = float(int(r[14:22],16))/1000000
if (lat > 360):
lat = lat - 2^32/1000000
lon = float(int(r[22:30],16))/1000000
if (lon > 360):
lon = lon - 2^32/1000000
r1 = int(r[30:38],16)
r2 = int(r[38:46],16)
print lat, lon, r1, r2
file.write('%s, %d, %d, %d, %f, %f, %d, %d\n' % (now_s, countrycode*100+operatorid, lac, cid, lat, lon, r1, r2))
file.write('%d, %d-%d, %f, %f\n' % (i, lac, cid, lat ,lon))
else:
print ('-', lac, cid, '- no data in gogle')
except:
print 'no data in google'
count_error = count_error+1
if(count_error > 20):
break
file.close() |
кому прокси не надо, комментируем строчки под #:
| Код: | proxy = "110.172.167.35:8080"
#proxy = "127.0.0.1:3128"
proxy = urllib2.ProxyHandler({"http" : proxy})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener) |
|
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Пт, 04.09.2009 11:41 Заголовок сообщения: |
|
|
| Netlog, куда прописать строчку ограничивающее координат поиска прямоугольником? и какая строчка |
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Сб, 05.09.2009 17:27 Заголовок сообщения: |
|
|
NetLog, интересно, а можно ли по запросу координат сканировать БС? а не как сейчас
то есть наоборот ввёл координаты, а Гугл тебе БС шпарит |
|
 |
Netlog
Известный нетмониторщик
Зарегистрирован: 02.02.2004
Сообщения: 468
Откуда: Ростов на Дону
Телефон: Siemens S35
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Сб, 05.09.2009 18:09 Заголовок сообщения: |
|
|
Нет, обратных запросов не предвидится, у гугло-яндекса нет такой задачи, выдавать CID-LAC.
Питон - 2.5.какой то, третьим не пользуюсь.
Чтобы оквадратить координаты, можно
| Код: | if (lat > 360):
lat = lat - 2^32/1000000
lon = float(int(r[22:30],16))/1000000
if (lon > 360):
lon = lon - 2^32/1000000
r1 = int(r[30:38],16)
r2 = int(r[38:46],16)
print lat, lon, r1, r2
file.write('%s, %d, %d, %d, %f, %f, %d, %d\n' % (now_s, countrycode*100+operatorid, lac, cid, lat, lon, r1, r2))
file.write('%d, %d-%d, %f, %f\n' % (i, lac, cid, lat ,lon)) |
заменить на
| Код: | if (lat > 360):
lat = lat - 2^32/1000000
lon = float(int(r[22:30],16))/1000000
if (lon > 360):
lon = lon - 2^32/1000000
r1 = int(r[30:38],16)
r2 = int(r[38:46],16)
print lat, lon, r1, r2
if (40.1>lat>50.2 and 30.3>lon>40.4):
file.write('%s, %d, %d, %d, %f, %f, %d, %d\n' % (now_s, countrycode*100+operatorid, lac, cid, lat, lon, r1, r2))
file.write('%d, %d-%d, %f, %f\n' % (i, lac, cid, lat ,lon)) |
|
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Сб, 05.09.2009 18:51 Заголовок сообщения: |
|
|
спасибо, но не помогло, мусор выдаёт:
Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 2.6.2
>>> ================================ RESTART ================================
>>>
('-', 1101)
54.532872 36.16868 2654 75
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1102)
53.366824 34.104118 3117 75
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1103)
54.544518 36.148606 2797 75
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1104)
54.531837 36.169803 1659 75
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1105)
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1106)
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1107)
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1108)
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
('-', 1109)
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
43.119868 6.128576 122000 80
и что это за циферки после координат? |
|
 |
Netlog
Известный нетмониторщик
Зарегистрирован: 02.02.2004
Сообщения: 468
Откуда: Ростов на Дону
Телефон: Siemens S35
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Вс, 06.09.2009 19:41 Заголовок сообщения: |
|
|
Да помогло. на печать то выводится всё подряд, но в файл идёт только то, что попадает в выделенный диапазон. Если и видеть не хочешь - перенеси print lat, lon, r1, r2 под if, и сдвинь на один пробел вправо.
Сам то я пишу в базу просто все ответы, ошибки, с тем, чтобы больше не запрашивать.
Первая цифирка после координат - это ошибка определения координат, размер кружочка в Гугл-картах в метрах. Чем меньшую площадь накрывает сектор, тем меньше эта цифирка. а ежели сектор светит вдоль автодороги, и с этим CID телефоны с GPSами передают координаты километров с 20 - то цифирка будет побольше. Вторая... не знаю. |
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Вт, 08.09.2009 18:42 Заголовок сообщения: |
|
|
| Netlog писал(а): | | Да помогло. на печать то выводится всё подряд, но в файл идёт только то, что попадает в выделенный диапазон. Если и видеть не хочешь - перенеси print lat, lon, r1, r2 под if, и сдвинь на один пробел вправо. |
сдвинул, ругается на ошибку в скрипте на тот же пробел |
|
 |
Netlog
Известный нетмониторщик
Зарегистрирован: 02.02.2004
Сообщения: 468
Откуда: Ростов на Дону
Телефон: Siemens S35
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Вт, 08.09.2009 20:26 Заголовок сообщения: |
|
|
| В питоне нет бегинов-ендов, нет скобок, а вложенность обозначается отступами. print должен быть на таком же уровне, как и всё прочее, что выполняется под if |
|
 |
milk
Гость
Зарегистрирован: 09.10.2009
Сообщения: 1
Оператор: МегаФон, МТС, БиЛайн
Вернуться к началу
|
Добавлено: Пт, 09.10.2009 16:35 Заголовок сообщения: |
|
|
На Дельфях и Питоне исходники уже были.
Приложу варианты на Яве и C#
Получение координат от Google
Java ME (CLDC 1.1 MIDP2.0)
| Код: |
import java.lang.*;
import java.io.*;
import javax.microedition.io
// Get Lat Lon for GSM Cell from Google DB
// double[0] - Lat; double[1] - Lon
public static double[] GoogleLatLon(int MCC, int MNC, int LAC, int CID)
{
try
{
HttpConnection hc = (HttpConnection)Connector.open("http://www.google.com/glm/mmap");
hc.setRequestMethod(HttpConnection.POST);
byte data[] = new byte[55];
data[0x01] = 0x0E; // fixed
data[0x10] = 0x1B; // fixed
for (int i = 0x2F; i <= 0x32; i++) data[i] = (byte)0xFF; // fixed
if (CID > 65536)
data[0x1c] = 5; // UTMS - 6 hex digits
else
data[0x1c] = 3; // GSM - 4 hex digits
int stOfs = 0x1f;
data[stOfs++] = (byte)((CID >> 24) & 0xFF); // 0x1f
data[stOfs++] = (byte)((CID >> 16) & 0xFF);
data[stOfs++] = (byte)((CID >> 8) & 0xFF);
data[stOfs++] = (byte)((CID) & 0xFF);
data[stOfs++] = (byte)((LAC >> 24) & 0xFF); //0x23
data[stOfs++] = (byte)((LAC >> 16) & 0xFF);
data[stOfs++] = (byte)((LAC >> 8) & 0xFF);
data[stOfs++] = (byte)((LAC) & 0xFF);
data[stOfs++] = (byte)((MNC >> 24) & 0xFF); // 0x27
data[stOfs++] = (byte)((MNC >> 16) & 0xFF);
data[stOfs++] = (byte)((MNC >> 8) & 0xFF);
data[stOfs++] = (byte)((MNC) & 0xFF);
data[stOfs++] = (byte)((MCC >> 24) & 0xFF); // 0x2b
data[stOfs++] = (byte)((MCC >> 16) & 0xFF);
data[stOfs++] = (byte)((MCC >> 8) & 0xFF);
data[stOfs++] = (byte)((MCC) & 0xFF);
hc.setRequestProperty("Content-Type","application/binary" );
hc.setRequestProperty("Content-Length", Integer.toString(data.length));
OutputStream os = hc.openOutputStream();
os.write(data);
os.close();
InputStream in = hc.openInputStream();
byte[] rd = new byte[15];
int totalBytesRead = 0;
while (totalBytesRead < rd.length)
totalBytesRead += in.read(rd, totalBytesRead, rd.length - totalBytesRead);
in.close();
hc.close();
short opcode1 = (short)(rd[0] << 8 | rd[1]);
byte opcode2 = rd[2];
int ret_code = (int)((rd[3] << 24) | (rd[4] << 16) | (rd[5] << 8) | (rd[6]));
if ((opcode1 == 0x0E) && (opcode2 == 0x1B) && (ret_code == 0))
{
double lat = ((double)((rd[7] << 24) | (rd[8] << 16) | (rd[9] << 8) | (rd[10]))) / 1000000;
double lon = ((double)((rd[11] << 24) | (rd[12] << 16) | (rd[13] << 8) | (rd[14]))) / 1000000;
return new double[] { lat, lon };
};
return new double[] { 0, 0 };
}
catch (Exception e) {};
return new double[] { 0, 0 };
}
|
Получение координат от Yandex
Java ME (CLDC 1.1 MIDP2.0)
| Код: |
import java.lang.*;
import java.io.*;
import javax.microedition.io
// Get Lat Lon for GSM Cell from Yandex DB
// double[0] - Lat; double[1] - Lon
public static double[] YandexLatLon(int MCC, int MNC, int LAC, int CID)
{
try
{
String url = "http://mobile.maps.yandex.net/cellid_location/"+
"?countrycode="+Integer.toString(MCC)+
"&operatorid="+Integer.toString(MNC)+
"&lac="+Integer.toString(LAC)+
"&cellid="+Integer.toString(CID);
HttpConnection hc = (HttpConnection)Connector.open(url);
hc.setRequestMethod(HttpConnection.GET);
InputStream in = hc.openInputStream();
StringBuffer str = new StringBuffer();
int ch;
while ((ch = in.read()) != -1) str.append((char)ch);
in.close();
hc.close();
String s = str.toString();
int iLat = s.indexOf(" latitude")+11; // space + latitude="
String sLat = s.substring(iLat,s.indexOf("\"",iLat));
int iLon = s.indexOf(" longitude")+12; // space + longitude="
String sLon = s.substring(iLon,s.indexOf("\"",iLon));
return new double[] { Double.parseDouble(sLat), Double.parseDouble(sLon) };
}
catch (Exception e) {};
return new double[] { 0, 0 };
}
|
Класс на C# (.Net 2.0 .Net CF 2.0)
| Код: |
using System;
using System.IO;
using System.Net;
using System.Xml;
namespace CellInform
{
/// <summary>
/// Cell Information DataBase Request Class
/// </summary>
class CellDBCall
{
/// <summary>
/// Prepare to HTTP POST Cell Information
/// </summary>
/// <param name="MCC">Mobile Country Code</param>
/// <param name="MNC">Mobile Network Code</param>
/// <param name="LAC">Local Area Code</param>
/// <param name="CID">Cell Identifier</param>
/// <returns>byte[] for HTTP POST</returns>
private static byte[] EncodeData(int MCC, int MNC, int LAC, int CID)
{
byte[] result = new byte[55];
result[0x01] = 0x0E; // fixed
result[0x10] = 0x1B; // fixed
for (int i = 0x2F; i <= 0x32; i++) result[i] = (byte)0xFF; // fixed
if (CID > 65536)
result[0x1c] = 5; // UTMS - 6 hex digits
else
result[0x1c] = 3; // GSM - 4 hex digits
// MSB..LSB
int endOffset = 0x2e;
foreach (byte b in BitConverter.GetBytes(MCC)) result[endOffset--] = b; // 0x2e .. 0x2b // 0x1f -- CID -- 0x22
foreach (byte b in BitConverter.GetBytes(MNC)) result[endOffset--] = b; // 0x2a .. 0x27 // 0x23 -- LAC -- 0x26
foreach (byte b in BitConverter.GetBytes(LAC)) result[endOffset--] = b; // 0x26 .. 0x23 // 0x27 -- MNC -- 0x2a
foreach (byte b in BitConverter.GetBytes(CID)) result[endOffset--] = b; // 0x22 .. 0x1f // 0x2b -- MCC -- 0x2e
return result;
}
/// <summary>
/// Locate Cell in Google CDB
/// </summary>
/// <param name="MCC">Mobile Country Code</param>
/// <param name="MNC">Mobile Network Code</param>
/// <param name="LAC">Local Area Code</param>
/// <param name="CID">Cell Identifier</param>
/// <param name="proxy">Proxy Server</param>
/// <returns>[0] - Latitude, [1] - Longitude</returns>
public static double[] GoogleLatLon(int MCC, int MNC, int LAC, int CID)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.google.com/glm/mmap");
req.UserAgent = "Firefox/3.0";
req.Method = "POST";
byte[] data = EncodeData(MCC, MNC, LAC, CID);
req.ContentType = "application/binary";
req.ContentLength = data.Length;
Stream outputStream = req.GetRequestStream();
outputStream.Write(data, 0, data.Length);
outputStream.Close();
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
byte[] rd = new byte[res.ContentLength];
int totalBytesRead = 0;
while (totalBytesRead < rd.Length)
totalBytesRead += res.GetResponseStream().Read(rd, totalBytesRead, rd.Length - totalBytesRead);
if (res.StatusCode == HttpStatusCode.OK)
{
short opcode1 = (short)(rd[0] << 8 | rd[1]);
byte opcode2 = rd[2];
int ret_code = (int)((rd[3] << 24) | (rd[4] << 16) | (rd[5] << 8) | (rd[6]));
if ((opcode1 == 0x0E) && (opcode2 == 0x1B) && (ret_code == 0))
{
double lat = ((double)((rd[7] << 24) | (rd[8] << 16) | (rd[9] << 8) | (rd[10]))) / 1000000;
double lon = ((double)((rd[11] << 24) | (rd[12] << 16) | (rd[13] << 8) | (rd[14]))) / 1000000;
return new double[] { lat, lon };
};
};
return new double[] { 0, 0 };
}
/// <summary>
/// Locate Cell in Yandex CDB
/// </summary>
/// <param name="MCC">Mobile Country Code</param>
/// <param name="MNC">Mobile Network Code</param>
/// <param name="LAC">Local Area Code</param>
/// <param name="CID">Cell Identifier</param>
/// <returns>[0] - Latitude, [1] - Longitude</returns>
public static double[] YandexLatLon(int MCC, int MNC, int LAC, int CID)
{
string url = "http://mobile.maps.yandex.net/cellid_location/?countrycode={0}&operatorid={1}&lac={2}&cellid={3}";
url = String.Format(url, new object[] { MCC, MNC, LAC, CID });
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.UserAgent = "Firefox/3.0";
req.Method = "GET";
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
Stream get = res.GetResponseStream();
byte[] rData = new byte[res.ContentLength];
get.Read(rData, 0, rData.Length);
get.Close();
XmlDocument xd = new XmlDocument();
xd.LoadXml(System.Text.Encoding.GetEncoding(1251).GetString(rData));
XmlNode xnLat = xd.SelectSingleNode("/location/coordinates/@latitude");
XmlNode xnLon = xd.SelectSingleNode("/location/coordinates/@longitude");
return new double[] { double.Parse(xnLat.Value, YaNoFInfo), double.Parse(xnLon.Value, YaNoFInfo) };
}
/// <summary>
/// Use for parse double in Yandex result
/// </summary>
private static System.Globalization.NumberFormatInfo YaNoFInfo
{
get
{
System.Globalization.NumberFormatInfo nf = new System.Globalization.NumberFormatInfo();
nf.NumberDecimalSeparator = ".";
return nf;
}
}
}
}
|
|
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Вс, 18.10.2009 16:42 Заголовок сообщения: |
|
|
выкладываю простенький скрипт для Гугла с прокси
| Код: | net, lac, rnc = 25501, 570, 0
import urllib2
proxy = "любой прокси"
proxy = urllib2.ProxyHandler({"http" : proxy})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
a, i = '000E00000000000000000000000000001B0000000000000000000000030000', 0
file = open("ozi.wpt","w")
file.write('OziExplorer Waypoint File Version 1.0\nWGS 84\nReserved 2\nReserved 3\n')
try:
for cid in range(65536)[10001:11006]:
b = hex(rnc*65536+cid)[2:].zfill(8) + hex(lac)[2:].zfill(8)
c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfill(8)
string = (a + b + c + 'FFFFFFFF00000000').decode('hex')
data = urllib2.urlopen('http://www.google.com/glm/mmap',string)
r = data.read().encode('hex')
if len(r) > 14 and int(r[22:23],16)==0 :
x, y, i = float(int(r[14:22],16))/1000000, float(int(r[22:30],16))/1000000, i+1
print cid, '-', x, y
file.write('%d, %d, %f, %f\n' % (i, cid, x, y))
except:
print 'connect error'
file.close()
|
кому прокси не нужны, можно закоментировать решёткой начало каждой из строк
| Код: | #proxy = "212.89.11.170:8080"
#proxy = urllib2.ProxyHandler({"http" : proxy})
$opener = urllib2.build_opener(proxy) |
|
|
 |
superemo
Начинающий нетмониторщик
Зарегистрирован: 29.11.2009
Сообщения: 7
Откуда: Sofia,BG
Телефон: Android LG GT540 & Nokia 6120c & Nokia 3310 Netmonitor
Оператор: и др.
Вернуться к началу
|
Добавлено: Ср, 02.12.2009 2:03 Заголовок сообщения: |
|
|
@McMaster,
Спасибо за легкого кода на скрипт.
Я хочу собирать БД для наше место, но я не знаю какие та лимитьй относно гоогле запросами :?:
Например 1000 для час, день ...
Есть ли вариант използую anonymous.org, чтобы обойти гоогле IP бан? |
|
 |
McMaster
Известный нетмониторщик
Зарегистрирован: 29.05.2005
Сообщения: 632
Откуда: Московская область
Телефон: HTC Artemis, Nokia 6600 (CellTrack+FTD)
Оператор: МегаФон
Вернуться к началу
|
Добавлено: Сб, 12.12.2009 18:04 Заголовок сообщения: |
|
|
| поделитесь пожайлуста новым скриптом для яндекс, яндекс запросы изменил или ответы |
|
 |
|
|
 |
|