Proxy localition

cesario678

Client
Регистрация
10.03.2022
Сообщения
179
Благодарностей
13
Баллы
18
Hello, I have a question. Can someone help me?

Is it possible to add a function to my bot that can detect the location of a proxy without me having to manually check a website and then take action based on that?

In this case, I need to know where my IP (proxy) is coming from. Is there any C# code or function that I can use to achieve this? Thank you.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 480
Благодарностей
5 917
Баллы
113
Hello, I have a question. Can someone help me?

Is it possible to add a function to my bot that can detect the location of a proxy without me having to manually check a website and then take action based on that?

In this case, I need to know where my IP (proxy) is coming from. Is there any C# code or function that I can use to achieve this? Thank you.
You can automate checking location on a website.
Just open the site and parse detected location from it.
Parse data.png
 

cesario678

Client
Регистрация
10.03.2022
Сообщения
179
Благодарностей
13
Баллы
18
Você pode automatizar a verificação de localização em um site.
Basta abrir o site e analisar a localização detectada a partir dele.
Посмотреть вложение 105618
[/CITAR]
Em relação aos dados de parse, ele não irá verificar se há algo específico que eu coloquei dentro dele? Por exemplo, se eu precisar ver o (estado do Brasil), esse estado irá variar de um proxy para outro. Nesse caso, como eu faria? Temos mais de 20 estados diferentes. Para cada um que aparece, preciso que vá para um local diferente no bot.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 480
Благодарностей
5 917
Баллы
113
You can parse the state with Parse data
check the result in Switch logic and depending on the result value go to required actions.
 
  • Спасибо
Реакции: cesario678

cesario678

Client
Регистрация
10.03.2022
Сообщения
179
Благодарностей
13
Баллы
18

myndeswx

Client
Регистрация
15.05.2017
Сообщения
436
Благодарностей
104
Баллы
43
Just a simple GET request (don't forget to add your actual proxy in the cubes 'proxy' tab)
And you get all the information needed neatly in a JSON format. Use "JSON processing" cube to get a single field that interests you.
105633




Or using C# you can also test the speed of that proxy at the same time, it's pretty convenient

C#:
        var timer = System.Diagnostics.Stopwatch.StartNew();
        string getas = ZennoPoster.HTTP.Request(
        method: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.GET,
        url: "https://wtfismyip.com/json",
        content: "body",
        contentPostingType: "application/json",
        proxy: project.Variables["proxy"].Value,
        Encoding: "UTF-8",
        respType: ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.BodyOnly,
        Timeout: 8000,
        Cookies: "",
        UserAgent: project.Profile.UserAgent,
        UseRedirect: false,
        MaxRedirectCount: 5,
        UseOriginalUrl: true,
        throwExceptionOnError: false,
        cookieContainer: project.Profile.CookieContainer,
        removeDefaultHeaders: true);
        timer.Stop();
project.SendWarningToLog(timer.Elapsed.ToString(),false);
project.Variables["timeSpent"].Value = timer.Elapsed.Milliseconds.ToString();
return getas;
Your proxy should be in variable named - proxy
 
Последнее редактирование:

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)