Raised This Month: $44 Target: $400
 11% 

Solved CURL: Downloanding an page ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-25-2022 , 07:27   CURL: Downloanding an page ?
Reply With Quote #1

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 .

Last edited by Craxor; 05-02-2022 at 03:50.
Craxor is offline
Send a message via ICQ to Craxor
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-25-2022 , 08:34   Re: CURL: Downloanding an page ?
Reply With Quote #2

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.
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2022 , 10:05   Re: CURL: Downloanding an page ?
Reply With Quote #3

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
__________________
Bugsy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-25-2022 , 10:26   Re: CURL: Downloanding an page ?
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
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.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2022 , 17:38   Re: CURL: Downloanding an page ?
Reply With Quote #5

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.
__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-25-2022 , 19:50   Re: CURL: Downloanding an page ?
Reply With Quote #6

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.
__________________

Last edited by fysiks; 04-28-2022 at 00:35.
fysiks is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-26-2022 , 16:47   Re: CURL: Downloanding an page ?
Reply With Quote #7

I think ill leave it , im to busy in real life and the.project seems to expensive, thanks everyone anyway:d
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-27-2022 , 00:35   Re: CURL: Downloanding an page ?
Reply With Quote #8

What page/data are you trying to retrieve? Ill see if I can get it to work
__________________
Bugsy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-27-2022 , 00:39   Re: CURL: Downloanding an page ?
Reply With Quote #9

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

Last edited by Craxor; 04-27-2022 at 00:46.
Craxor is offline
Send a message via ICQ to Craxor
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-27-2022 , 06:15   Re: CURL: Downloanding an page ?
Reply With Quote #10

Quote:
Originally Posted by DruGzOG View Post
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
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...)
JocAnis is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:32.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode