2017-05-23 13:47:24

Hello guys!
I had already posted this code made by me in the blastbay forum, but I put it here anyway because it can be very useful for someone.
After much thought on how I could do this, I finally succeeded!
I needed a lot to develop an algorithm to escape html tags, since I've been working a lot on bgt lately, but separating information from html tags was very tedious!
So, this script strips html tags from a string. In other words, you can get back the string only with text of pages.
Please note that this is a very simple code, which escapes almost all html tags, but codes that work on the client side (javascript, css, and so on) can remain in the text. Even so, this helps a lot to search for some information that you know is on the page, for example, but that can change places, so it is very complicated to intercept with the html tags.
That said, so that you have no doubt how to use this code, a brief explanation follows:

Create a script with any name and add this code below:
#include "strip_tags.bgt"
http t;
string test;
void main(){
test=t.get("http://www.blastbay.com/bgt.php");
while (t.progress) test+=t.request();
strip_tags(test);
alert ("test",string_with_tags);
}

If you want, you can take this last statement, just to show the result of the page already without the html tags.
The string_with_tags variable is global, and it is with it that you get the result.
That simple!
This function even exchanges some special characters in the html (&aacut, &eacut, etc), by the original characters (á, é, etc).
There may be others that need to be added, so anyone who wants to tinker with the code and contribute, can feel free!
Download Link:
https://www.dropbox.com/s/2f4huy7y7gqaq … s.bgt?dl=1
Enjoy!

2017-05-23 22:25:42

Nice, i saw it on the blastbay forum but i no longer have my account.