Raised This Month: $51 Target: $400
 12% 

Get website title


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 08-18-2022 , 03:24   Get website title
Reply With Quote #1

An example of getting website title using ripext extension
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-18-2022 , 07:49   Re: Get website title
Reply With Quote #2

...seems answer lost in bit space inside Discord
https://discord.com/channels/3352909...33760431964171


Quote:
Originally Posted by Impact

tänään klo 11.01
Not my finest code but here's an example. It requires checks and research when or if you need to close the handle(s). I'd also use regex to extract the data. Regex and html go well together 😉
PHP Code:
public void OnPluginStart()
{
    
Handle hRequest SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET"http://sourcemod.net");
    
SteamWorks_SetHTTPCallbacks(hRequest, .fData=OnHTTPDataReceived);
    
SteamWorks_SendHTTPRequest(hRequest);
}

void OnHTTPDataReceived(Handle hRequestbool bFailureint offsetint bytesreceived)
{
    
int size;
    
SteamWorks_GetHTTPResponseBodySize(hRequestsize);
    
    
char[] body = new char[size];
    
SteamWorks_GetHTTPResponseBodyData(hRequestbodysize);
    
    
    
int searchLen strlen("<title>");
    
int start StrContains(body"<title>") + searchLen;
    
int end StrContains(body[start], "</");
    
    
body[start+end] = '\0';
    
PrintToServer("Title: \"%s\""body[start]);

You probably have to use #pragma dynamic
Bacardi is offline
Reply



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


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