AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved CURL: Downloanding an page ? (https://forums.alliedmods.net/showthread.php?t=337507)

Craxor 04-25-2022 06:27

CURL: Downloanding an page ?
 
Hi , before answering this topic please don't write "search" i've already scraped the entire forum and google to look for CURL tutorials, and guess what? I found shit .

I'm trying to create a simple CURL plugin that downloands an GameTracker player page , but how to do that ? and what does download CURL ? I've read all internet and absolutly no one gives a simple idiotic answer at least .

my answer is clear: If i downloand with CURL , what the heck is actualy downloanding ? The http source code of the page or what ?

Even the examples on github of the CURL OP they not even work, gives me errors wich i don't undersntad :


Is there an way to retrieve data with CURL so i don't need to downloand the entire page , something like searching on web page keywords to retrieve output, please, again i reapeat don't tell me about tutorials on google, i've already readed them and i don't understand nothing, so theres is no point in telling me again that, i understand better when i'm actualy talking with people, thanks for patience and support .

Code:


//// atest.sma
//scripting\include\curl_consts.inc(497) : warning 200: symbol "CURLINFO_CONTENT_LENGTH_DOWNLOA" is truncated to 31 characters
//scripting\include\curl_consts.inc(1033) : warning 200: symbol "CURLOPT_CONV_FROM_NETWORK_FUNCT" is truncated to 31 characters
//scripting\include\curl_consts.inc(1037) : warning 200: symbol "CURLOPT_CONV_TO_NETWORK_FUNCTIO" is truncated to 31 characters

What the heck does they mean ? i just downloanded the curl, instaled and used the example from github with http_get .

DruGzOG 04-25-2022 07:34

Re: CURL: Downloanding an page ?
 
What you're trying to do with the gametracker api/ stats look up won't work with curl just cause it has its own captcha that will prevent the data from being read. You have a better chance this working on HL2 games then HL1 games.

Bugsy 04-25-2022 09:05

Re: CURL: Downloanding an page ?
 
I updated my VAC Ban Status plugin to use cURL if you want to take a look:

https://forums.alliedmods.net/showthread.php?t=84505

Craxor 04-25-2022 09:26

Re: CURL: Downloanding an page ?
 
Quote:

Originally Posted by Bugsy (Post 2777886)
I updated my VAC Ban Status plugin to use cURL if you want to take a look:

https://forums.alliedmods.net/showthread.php?t=84505


I will, but can you please those questions bugsy please:

1. Will it work with gametracker too, or i'm wasting my time as Drgzor said ?
2. What does DOWNLOAD Curl? Is there a way to read directly keys[] from webcontent or i have to downonload something with Curl and then search using amxx functions if it downlonads html sources.

Bugsy 04-25-2022 16:38

Re: CURL: Downloanding an page ?
 
It depends if the server is equipped to handle the request for a specific data element. It can either respond with a HTML packet with your requested data element, or you request an entire file/page and read data off of it.

Get a packet sniffer, or maybe your browser supports showing the data for the HTTP request.

fysiks 04-25-2022 18:50

Re: CURL: Downloanding an page ?
 
cURL downloads whatever the server gives you based on your request (that's probably a gross simplification but in this context it's probably good enough). Generally, if you request a webpage, you'll get the same data that your browser would get (often colloquially called HTML).

From some basic searching online, it doesn't look like GameTracker has a public API for getting data from it but there was mention of a "feed" available for premium members. See this thread.

Also, I found some python code that appears to grab the HTML and seeks out the data in the HTML.

Craxor 04-26-2022 15:47

Re: CURL: Downloanding an page ?
 
I think ill leave it , im to busy in real life and the.project seems to expensive, thanks everyone anyway:d

Bugsy 04-26-2022 23:35

Re: CURL: Downloanding an page ?
 
What page/data are you trying to retrieve? Ill see if I can get it to work

Craxor 04-26-2022 23:39

Re: CURL: Downloanding an page ?
 
Bugsy, im trying to retrieve All Time Stats from gametracker players page . Ive tried a lot of things, both HTTP and Curl and displaying with motd but no succes .

Random example: https://www.gametracker.com/player/f....255.68:27111/

Stats:
Code:

ALL TIME STATS
Score: 610785
Minutes Played: 13208
Score per Minute: 46.2
Rank on Server: #293 out of 26472

Edit: I also want to divide Minutes with 60 to get the actual hours and decrease rank numbers # -1 cuz i have a fakebot on server whos always there :p

JocAnis 04-27-2022 05:15

Re: CURL: Downloanding an page ?
 
Quote:

Originally Posted by DruGzOG (Post 2777877)
What you're trying to do with the gametracker api/ stats look up won't work with curl just cause it has its own captcha that will prevent the data from being read. You have a better chance this working on HL2 games then HL1 games.

Where is captcha on gametracker


All times are GMT -4. The time now is 00:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.