View previous topic :: View next topic |
Author |
Message |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Wed Mar 03, 2021 1:43 pm Post subject: [Solved] m00nie eggdrop URL title grabbing script |
|
|
Hi all,
I've been using this script for a long time. Works well with youtube links.
Nowadays I started to look for a script which gives back the title of every other webpage (http and https), but none of them worked for me.
I would like to ask someone (especially m00nie ) to make this modification on the youtube script. We would get a full url grabber script.
The script can be grabbed from here:
https://www.m00nie.com/youtube-eggdrop-script-using-api-v3/
Last edited by m4s on Thu Mar 25, 2021 2:12 pm; edited 2 times in total |
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Sat Mar 06, 2021 5:28 pm Post subject: |
|
|
Hi m4s
I gave this a go here https://m00nie.com/eggdrop-url-title-grabbing-script/ although it's not part of the YouTube script just yet. I might mangle it together with the YouTube and Twitter scripts though in the future if this one seems to work ok in the next while
Cheers
m00nie |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Sun Mar 21, 2021 4:48 pm Post subject: |
|
|
Hi m4s
v1.3 might solve some of the probs you had (I couldn't replicate them all )
The 301 redirection handling was quite new for me at least but good to poke into. It's definitely not finished but it might be less broken than it was before
Cheers
m00nie |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Mon Mar 22, 2021 3:22 am Post subject: |
|
|
Hi m00nie,
Thanks for your work.
I have tested the v1.3.
The 301 moved permanently error disappeared. The script gives fine result from www.nemzetisport.hu & from www.dw.com as well.
If i post a link from politico.eu containing quotation marks I get these strange results:
& # 8 2 1 6 ; grown-ups & # 8 2 1 7 ; & # 8 2 1 1 ; POLITICO.
But acc to google: & # 8 2 1 6 ; and & # 8 2 1 7 ; = quotation mark (left and right) and & # 8 2 1 1 ; = dash.
(just added space between the characters if a don't i get quotation marks and dash )
Links from https://www.origo.hu gives this error:
Tcl error [m00nie::linktitle::autoinfo]: can't read "status": no such variable
If i change this line
Code: | putlog "m00nie::linktitle::gettitle $host returned status message of $status." |
to
Code: | putlog "m00nie::linktitle::gettitle $host returned status message of status." |
the script runs but i get no result.
In DCC i write: .set errorInfo
Currently: can not find channel named "sock55e1c6436b60"
Currently: while executing
Currently: "eof $sock"
My locale:
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=hu_HU.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
Thank you again!
Cheers |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Mon Mar 22, 2021 7:09 am Post subject: |
|
|
Could you try a string map instead of regsub?
Code: |
proc makepretty {title} {
return [string map [list "'" "'" "&" "\&" """ "\"" "<" "<" ">" ">" "\n" ""] $title]
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Tue Mar 23, 2021 3:47 am Post subject: |
|
|
Quote: | Could you try a string map instead of regsub? |
If you asked me caesar my answer is I am not coder.
I was just lucky found the 'solution' for the "politico" problem.
By the way I did some more test and I'm in trouble with hungarian characters.
From a web I got this:
https://i.imgur.com/lkuGDPQ.jpg
Should be: Másfél millióra büntették.
If I add it to the script it works ( https://i.imgur.com/lz9wu9O.jpg ) but is it possible not to give all these characters one by one?
Thank you to everyone!  |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Tue Mar 23, 2021 3:01 pm Post subject: |
|
|
á ; (without the space after the 5 cos forum interprets it) is the Latin small letter a with acute (meaning á) in ASCII table. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Wed Mar 24, 2021 11:26 am Post subject: |
|
|
caesar wrote: | á ; (without the space after the 5 cos forum interprets it) is the Latin small letter a with acute (meaning á) in ASCII table. |
Yes, I know.
Is it possible to modify the script that i do not have to add all of these latin characters one by one? |
|
Back to top |
|
 |
CrazyCat Owner

Joined: 13 Jan 2002 Posts: 955 Location: France
|
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Wed Mar 24, 2021 4:35 pm Post subject: |
|
|
v1.4 now include the decoding as suggested by CrazyCat Thanks for the point in the right direction CrazyCat wouldn't have thought of that so cheers
Cheers
m00nie |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Thu Mar 25, 2021 2:12 pm Post subject: |
|
|
m00nie wrote: | v1.4 now include the decoding as suggested by CrazyCat Thanks for the point in the right direction CrazyCat wouldn't have thought of that so cheers
Cheers
m00nie |
Thank you m00nie!
I had to add one more character: "ő" "\ő ;"
The script works perfectly thank you for your help!
Thanks for CrazyCat as well!
Grab it: https://www.m00nie.com/eggdrop-url-title-grabbing-script/ |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Sun Mar 28, 2021 2:56 pm Post subject: |
|
|
Hello
I have just got a strange result:
Instead of:
Why is this happen?
I upgraded my eggdrop from 1.8.4 to 1.9.
Thx! |
|
Back to top |
|
 |
CrazyCat Owner

Joined: 13 Jan 2002 Posts: 955 Location: France
|
Posted: Sun Mar 28, 2021 6:42 pm Post subject: |
|
|
probably there is a conversion from or to utf8 in the script which is no more required with eggdrop1.9. _________________ https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
Back to top |
|
 |
|