Reading Web Content info ?
Hi, I am trying to make a plugin to retrieve from game tracker the "ALL TIME STATS" Info per user .
I've browesd the forum a little and found tons of Modules/INC wich I "suspect" (because i am not sure and i am realy noob at this) this could be made trough them, Sockets, cURL, THREADED HTPP, HTTP:X, HTTP, HTPPX, bla bla and so on, my questionS are : 1. Wich is the easiest/friendly-user to learn and use in my goal? 2. Wich is the fastest ( as i read, some are called after a while, idk wich, is there one wich could make to retrieve the Info almost instantly for the user eyes? I am trying to make an plugin wich when users type /playedtime, will show a menu or an motd with his ALL TIME STATS on gametracker ) . 3. How to actualy done it, please a little support :P (this if answered to the other two questions ) . Thanks in advance guys . |
Re: Reading Web Content info ?
Use curl module, or sockets if you're reading only http requests.
|
Re: Reading Web Content info ?
https://github.com/bigdaddy424/alliedmods-scraped-api
There's plenty of tutorials how to scrape data from websites. As long as these websites don't have anti-bot captchas you're safe. |
Re: Reading Web Content info ?
Nathseh thank ill give a try with curl module, but curl module does require any special instalation or is an module as any others ?
Bigdaddy, the link you provide has no example in it, what about it? |
Re: Reading Web Content info ?
yes you need to install the module not a big deal its not included in the normal amxmodx package so yes.
|
Re: Reading Web Content info ?
Quote:
.i readed the comments from the topic and Prostetamoto said something about an Meta plugin or something like that , i couldnt grasp the conversation because were too much for me . |
Re: Reading Web Content info ?
No its an amxx module, nothing required.
|
Re: Reading Web Content info ?
Nat. , i readed a little about CURL, but is fucking complicated, are you sure is easier with Curl rather than Sockets ? ( I mean when you have zero knowledeb about subject as me ) .
Anyway . What exactly does Curl? Please explain in normal terms not programmer terms . If i use curl to retrieve data from an Gametracker page of an User, could i Read one of more Info from there just by inserting an Key ? Or the CURL function would downloand an entire page and i have to use Regex to search for my keywords and delete the rest of the content ? I found this website ( https://reqbin.com/req/c-1n4ljxb9/cu...equest-example ) If i use CURL on gametracker of an player page, would give me an PHP source code , Does that mean the Curl module uses getinfo function to download source codes of the http i insert, and i have to use Regex in order to substring my info i need to retrieve ? I'm sorry but i am really confused about how this module works, and all the info and people were talking about it made it even more confusing because they were talking in PROGRAMMING terms, but i'm not an programmer . |
Re: Reading Web Content info ?
Sockets only retrieves data using HTTP request while cURL support multiple protocols & requests.
|
Re: Reading Web Content info ?
Do not use sockets for that purpose, stick with curl.
https://github.com/Next21Team/AmxxCurl I won't go in-depth about the differences but with sockets, if you do multiple requests within a short interval of time, you may receive the response all at once instead of in pieces for each request, you wouldn't know which request the response belongs to. You don't have this problem with curl, all you really need is to send the request, once curl receives the response, it will trigger the callback. Curl is pretty simple, there is plenty of information on google, just search. There is even a couple of examples of how to use AmxxCurl module, https://github.com/Next21Team/AmxxCu...r/amx_examples Now regarding how to get the stats of a player, you won't request the stats page, instead, you have to request the gametracker API, it will return either an XML or a JSON response containing all the information of the specified player. Alternatively, you could just show a motd pointing to the player stats page. |
| All times are GMT -4. The time now is 21:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.