SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 08/12/2018, 04:18 PM   #31
ball
Huge Clucker
 
ball's Avatar
 
Join Date: Jul 2012
Location: Poznan, Poland
Posts: 279
Reputation: 33
Default Re: PawnScraper

Thanks for yt2mp3 solution. How to get song time duration? I tried the same way as title, but it doesn't work, it gives me null string.
ball is offline   Reply With Quote
Old 09/12/2018, 06:29 AM   #32
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: PawnScraper

Quote:
Originally Posted by ball View Post
Thanks for yt2mp3 solution. How to get song time duration? I tried the same way as title, but it doesn't work, it gives me null string.
Duration can be scraped easily.The html of site is
HTML Code:
<div class="col-md-9">
     <p>
         <b>Title of Song</b>
     </p>
     <p>
          <b>Duration:</b> 00:03:18
      </p>
</div>
We can use selector like this
PHP Code:
new 
    
Selector:DurationSelector ParseSelector(".col-md-9>p"),
    
Duration[30];

GetNthElementText(html,DurationSelector,1,Duration);//second occurrence so n=1
strmid(Duration,Duration,10sizeof Duration);//remove the Text "Duration: "
DeleteSelector(DurationSelector); 
Then parse it according to your needs.

Last edited by SyS; 15/12/2018 at 04:29 AM.
SyS is offline   Reply With Quote
Old 16/12/2018, 02:50 AM   #33
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: PawnScraper

Quote:
Originally Posted by Amagida View Post
I can't do this, because its just game host. discord-connector uses libssl as i know, but i can use it.
Maybe your server is using older linux.Can you try this build.
https://github.com/Sreyas-Sreelal/pa...x86-Ubuntu.zip
It's compiled on Ubuntu 14.04 with older openssl (1.0) and glibc
SyS is offline   Reply With Quote
Old 16/12/2018, 05:08 AM   #34
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,571
Reputation: 332
Default Re: PawnScraper

Good job.
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 13/01/2019, 05:31 AM   #35
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: PawnScraper

New Version (v0.2.0)
https://github.com/Sreyas-Sreelal/pa...ases/tag/0.2.0

Changes
  • Added CreateHeader,DeleteHeader natives
  • Changed function signatures of HttpGet and HttpGetThreaded (optional parameter header is added)
  • Added new constant INVALID_HEADER

More information available on the main post
SyS is offline   Reply With Quote
Old 15/03/2020, 04:31 PM   #36
DmitriyShift
Little Clucker
 
DmitriyShift's Avatar
 
Join Date: Jun 2019
Posts: 39
Reputation: 3
Default Re: PawnScraper

[12:26:14] Loading plugin: PawnScraper.so
[12:26:14] Failed (/lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.28' not found (required by plugins/PawnScraper.so))


the plugin does not work when the server is launched.
__________________
DmitriyShift is offline   Reply With Quote
Old 18/03/2020, 07:54 AM   #37
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: PawnScraper

Quote:
Originally Posted by DmitriyShift View Post
[12:26:14] Loading plugin: PawnScraper.so
[12:26:14] Failed (/lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.28' not found (required by plugins/PawnScraper.so))


the plugin does not work when the server is launched.
you might want to recompile the plugin for your server..
SyS is offline   Reply With Quote
Old 19/03/2020, 06:21 PM   #38
DmitriyShift
Little Clucker
 
DmitriyShift's Avatar
 
Join Date: Jun 2019
Posts: 39
Reputation: 3
Default Re: PawnScraper

Quote:
Originally Posted by SyS View Post
you might want to recompile the plugin for your server..
I've already solved it.... thaks you.

can you help me? I am trying to create an anti proxy and i want to understand how to get the plugin to verify this information.

this is verify proxy alt="Proxy/VPN"> Proxy/VPN Detected


PHP Code:
<div class="ip-lookup-report-wrapper">
<
class="big text-bold headerHR" style="border-bottom: 1px dotted #cbcbcb;">IP Address Lookup Details for 220.95.121.20</p>
<
table class="ip-lookup-report clearfix">
<
tbody><tr>
<
td>IP Address</td>
<
td>220.95.121.20</td>
</
tr>
<
tr>
<
td>Country</td>
<
td>KR <img width="24" alt="KR" src="/templates/img/icons/country-flags/kr.svg" style="vertical-align: text-bottom;margin-left: 3px;"></td>
</
tr>
<
tr>
<
td>Fraud Score</td>
<
td>
<
span style="color:#b91414;">89 High Risk</span>
<
br><span><small>Fraud Scores are enhanced by passing additional details through our API and CSV batch checks.</small></span>
</
td>
</
tr>                            
<
tr>
<
td>Mail SPAM Block List</td>
<
td>
<
img src="/templates/img/fraudulent-IP-address.png" style="vertical-align: top; width:24px;" alt="Blacklisted"IP Reported as Blacklisted
</td>
</
tr>
<
tr>
<
td>Proxy/VPN Detection</td>
<
td>
<
img src="/templates/img/proxy-detected.png" style="vertical-align: top; width:24px;" [B][COLOR="Red"]alt="Proxy/VPN"> [/COLOR][/B]Proxy/VPN Detected
<br><span><small>This IP address appears to be a high risk proxy connection.</small></span>
</
td>
</
tr>
<
tr>
<
td>Bot Activity <span class="label label-danger">New</span></td>
<
td>
Please <class="text-bold" style="color: #279AE2;" href="/create-account">sign up</ato view the bot status data point.
</
td>
</
tr>                                
<
tr>
<
td>City</td>
<
td>Yangsan</td>
</
tr>
<
tr>
<
td>Region</td>
<
td>Gyeongsangnam-do</td>
</
tr>

<
tr>
<
td>Hostname</td>
<
td>220.95.121.20</td>
</
tr>
<
tr>
<
td>ISP</td>
<
td>Korea Telecom</td>
</
tr>
<
tr>
<
td>ASN</td>
<
td><class="text-bold" style="color: #279AE2;" href="/asn-details/AS4766/korea-telecom">AS4766 Korea Telecom</a></td>
</
tr>
<
tr>
<
td>Organization</td>
<
td>Korea Telecom</td>
</
tr>
<
tr>
<
td>Time Zone</td>
<
td>Asia/Seoul</td>
</
tr>
<
tr>
<
td>Latitude</td>
<
td>34.8</td>
</
tr>
<
tr>
<
td>Longitude</td>
<
td>128.39</td>
</
tr>
<
tr>
<
td>CIDR IP Address Subnet</td>
<
td><class="text-bold" style="color: #279AE2;" href="/free-ip-lookup-proxy-vpn-test/lookup/block/220.95.121.0/24">220.95.121.0/24</a></td>
</
tr>
</
tbody></table>
<
class="text-center" style="border: 0;border-top: 1px solid #eee;padding-top: 10px;margin-top: 10px;"><a href="/create-account" class="text-bold" style="color: #279AE2;">Create a free account</ato access more lookup details with greater accuracy.</p>

</
div
__________________
DmitriyShift is offline   Reply With Quote
Old 31/03/2020, 04:06 AM   #39
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: PawnScraper

Quote:
Originally Posted by DmitriyShift View Post
I've already solved it.... thaks you.

can you help me? I am trying to create an anti proxy and i want to understand how to get the plugin to verify this information.

this is verify proxy alt="Proxy/VPN"> Proxy/VPN Detected


PHP Code:
<div class="ip-lookup-report-wrapper">
<
class="big text-bold headerHR" style="border-bottom: 1px dotted #cbcbcb;">IP Address Lookup Details for 220.95.121.20</p>
<
table class="ip-lookup-report clearfix">
<
tbody><tr>
<
td>IP Address</td>
<
td>220.95.121.20</td>
</
tr>
<
tr>
<
td>Country</td>
<
td>KR <img width="24" alt="KR" src="/templates/img/icons/country-flags/kr.svg" style="vertical-align: text-bottom;margin-left: 3px;"></td>
</
tr>
<
tr>
<
td>Fraud Score</td>
<
td>
<
span style="color:#b91414;">89 High Risk</span>
<
br><span><small>Fraud Scores are enhanced by passing additional details through our API and CSV batch checks.</small></span>
</
td>
</
tr>                            
<
tr>
<
td>Mail SPAM Block List</td>
<
td>
<
img src="/templates/img/fraudulent-IP-address.png" style="vertical-align: top; width:24px;" alt="Blacklisted"IP Reported as Blacklisted
</td>
</
tr>
<
tr>
<
td>Proxy/VPN Detection</td>
<
td>
<
img src="/templates/img/proxy-detected.png" style="vertical-align: top; width:24px;" [B][COLOR="Red"]alt="Proxy/VPN"> [/COLOR][/B]Proxy/VPN Detected
<br><span><small>This IP address appears to be a high risk proxy connection.</small></span>
</
td>
</
tr>
<
tr>
<
td>Bot Activity <span class="label label-danger">New</span></td>
<
td>
Please <class="text-bold" style="color: #279AE2;" href="/create-account">sign up</ato view the bot status data point.
</
td>
</
tr>                                
<
tr>
<
td>City</td>
<
td>Yangsan</td>
</
tr>
<
tr>
<
td>Region</td>
<
td>Gyeongsangnam-do</td>
</
tr>

<
tr>
<
td>Hostname</td>
<
td>220.95.121.20</td>
</
tr>
<
tr>
<
td>ISP</td>
<
td>Korea Telecom</td>
</
tr>
<
tr>
<
td>ASN</td>
<
td><class="text-bold" style="color: #279AE2;" href="/asn-details/AS4766/korea-telecom">AS4766 Korea Telecom</a></td>
</
tr>
<
tr>
<
td>Organization</td>
<
td>Korea Telecom</td>
</
tr>
<
tr>
<
td>Time Zone</td>
<
td>Asia/Seoul</td>
</
tr>
<
tr>
<
td>Latitude</td>
<
td>34.8</td>
</
tr>
<
tr>
<
td>Longitude</td>
<
td>128.39</td>
</
tr>
<
tr>
<
td>CIDR IP Address Subnet</td>
<
td><class="text-bold" style="color: #279AE2;" href="/free-ip-lookup-proxy-vpn-test/lookup/block/220.95.121.0/24">220.95.121.0/24</a></td>
</
tr>
</
tbody></table>
<
class="text-center" style="border: 0;border-top: 1px solid #eee;padding-top: 10px;margin-top: 10px;"><a href="/create-account" class="text-bold" style="color: #279AE2;">Create a free account</ato access more lookup details with greater accuracy.</p>

</
div
It can simply done this way
PHP Code:
 //<img src="/templates/img/proxy-detected.png" style="vertical-align: top; width:24px;" alt="Proxy/VPN">
    ///replace the arguement to ParseHtmlDocument with your variable storing html content
    
new Html:doc ParseHtmlDocument("\
        <img src=\"/templates/img/proxy-detected.png\" style=\"vertical-align: top; width:24px;\" alt=\"Proxy/VPN\">\
    "
);
    
///Create a css selector to select the tag and attribute
    //This selector selects all img tags with src attribute containing proxy-detected.png
    
new Selector:selector ParseSelector("img[src*=\"proxy-detected.png\"]");
    new 
proxy[12];
    
///get the first match' alt attrbiute's value
    
GetNthElementAttrVal(doc,selector,0,"alt",proxy);
    print(
proxy);
    
///Delete created instances to avoid memory leaks
    
DeleteHtml(doc);
    
DeleteSelector(selector); 
SyS is offline   Reply With Quote
Old 31/03/2020, 08:40 AM   #40
DmitriyShift
Little Clucker
 
DmitriyShift's Avatar
 
Join Date: Jun 2019
Posts: 39
Reputation: 3
Default Re: PawnScraper

Quote:
Originally Posted by SyS View Post
It can simply done this way
[PHP]
//<img src="/templates/img/proxy-detected.png" style="vertical-align: top; width:24px;" alt="Proxy/VPN">
///replace the arguement to ParseHtmlDocument with your variable storing html content
new Html:doc = ParseHtmlDocument("\
<img src=\"/templates/img/proxy-detected.png\" style=\"vertical-align: top; width:24px;\" alt=\"Proxy/VPN\">\
");
///Create a css selector to select the tag and attribute
//This selector selects all img tags with src attribute containing proxy-detected.png
new Selectorelector = ParseSelector("img[src*=\"proxy-detected.png\"]");
new proxy[12];
///get the first match' alt attrbiute's value
GetNthElementAttrVal(doc,selector,0,"alt",proxy);
print(proxy);
///Delete created instances to avoid memory leaks
DeleteHtml(doc);
DeleteSelector(selector);
[PHP]
nice.... thank you! 5 stars
__________________

Last edited by DmitriyShift; 31/03/2020 at 09:27 AM.
DmitriyShift is offline   Reply With Quote
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



All times are GMT. The time now is 04:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.