Raised This Month: $ Target: $400
 0% 

Socket help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
JocAnis
Veteran Member
Join Date: Jun 2010
Old 12-20-2018 , 13:41   Re: Socket help
Reply With Quote #7

you can try with this, i had similar topic : https://forums.alliedmods.net/showthread.php?t=311173
Code:
#include <httpx>
#include <regex> 
new Buffer[ 1024 ]

HTTPX_Download( "your site", _, "when_it_finish", "progress" ) //see this at HTTP:X

public when_it_finish() client_print( 0, print_chat, "download page finished" )

public progress( id ) 
{
	new RegeX:res

	while ( ( len = HTTPX_GetData( Buffer, charsmax( Buffer ) ) ) ) 
	{
		new error[50], num 
		
		new Regex:res=regex_match(Buffer, "voturi-azi^">(.*?)</a>", num, error, 49)
	
		if(res)
		{ 
			new wanted_text[300]	// create buffer to store wanted_text 
			regex_substr(res, 1, wanted_text, charsmax(wanted_text)); // retrieve wanted_text 
			server_print("zm vote: %s", wanted_text); // wanted_text: I am wanted 
			regex_free(res); // free the regex handle to prevent memory leak 
		}  
    }
    return PLUGIN_CONTINUE
}
i hope it helps
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 12-20-2018 at 13:43.
JocAnis is offline
 



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 07:32.


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