CURL Help
hello. I'm trying to make an autoupdater for a plugin with curl, but i don t get how to use it. I was looking up on Bugsy's vacbans when i realized that i don't understand a single thing of that curl.
that is the code i was trying to make PHP Code:
First of all, i tried to read a site: https://lexzor.warface.ro/AutoUpdate/Test/version.txt From links like this i would like to read latest versions of my plugins. Can i get some help with this ? |
Re: CURL Help
You already got a link to documentation in the other thread. https://curl.se/libcurl/c/
Use it. For example, for CURLOPT_CAINFO you would click on curl_easy_setopt, then search for CURLOPT_CAINFO and finally get here: https://curl.se/libcurl/c/CURLOPT_CAINFO.html Also google for curl tutorials and examples. They may be in C, but the API is very similar. If you use linux or WSL you can always play with "curl" from command line to get a better feel for how it works. For example: Code:
curl https://lexzor.warface.ro/AutoUpdate/Test/version.txtCode:
snip:~$ curl https://lexzor.warface.ro/AutoUpdate/Test/version.txt |
Re: CURL Help
I don't understand a shit, i need smth like a tutorial, but i m giving up.
thanks 4 ur help |
Re: CURL Help
You will not find an AMX-X tutorial for cURL, but as HamletEagle said, find an example written in C and just code it in AMX-X as the API is pretty much identical.
|
Re: CURL Help
Have you checked this out? https://github.com/Polarhigh/AmxxCur...s/http_get.sma
And this? https://forums.alliedmods.net/showthread.php?t=285656 What are you trying to achieve? |
Re: CURL Help
Every time i get another output, but in console because i can t write the file.
PHP Code:
|
Re: CURL Help
You have to access the data when the callback is called, printing it right after you send the request is useless and prone to race conditions.
|
Re: CURL Help
Your above code successfully wrote a text file for me containing '998', what is the problem?
Please explain what you are trying to do. |
Re: CURL Help
I m trying to make an auto updater using curl. I want to check the version from a .txt file and if is not the same with plugin verison then download the plugin from webhost.
The problem with the above code is that i get no output data in .txt file. In first instance i was thinking that i don't install correctly the curl module and that was right, in modules.ini i wrote only "curl" then i saw a post here and modify it in curl_amxx, but i get the same result: - no data .txt file. - different output in console - First map change: 167226000 - Second map change: 167339376 and so on... every time different output. I m using amxx 1.9. Does it matter if i'm using hlds or rehlds? |
Re: CURL Help
No need to write to a local file
PHP Code:
Output: Code:
Upgrade is needed [998 > 997]Output: Code:
Upgrade not needed [Is 998 > 998 ?] |
| All times are GMT -4. The time now is 02:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.