This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

adding view count to youtube script

Help for those learning Tcl or writing their own scripts.
Post Reply
h
hayuto
Voice
Posts: 14
Joined: Tue May 28, 2013 6:52 pm

adding view count to youtube script

Post by hayuto »

i have this script http://paste.tclhelp.net/?id=dci and i wanted to add view count to this script, i see in gdta there is <yt:statistics favoriteCount='0' viewCount='121146018'/> but my head hurts when i try to figure out regexp for this, also i dont really know tcl :P i just read this scripts and fix them from time to time or translate but this is huge :D i think it should be no brainer for anyone who knows tcl good, or if you dont want to do it maybe just tell me what to do, like do i need to convert it to utf8 like the he converts date and rating, things like that. Thanks for any help!:D

edit: and maybe other info too like who uploaded etc :o
h
hayuto
Voice
Posts: 14
Joined: Tue May 28, 2013 6:52 pm

Post by hayuto »

for youtuber name i added

Code: Select all


                if {[regexp -nocase {<name>(.{1,})<\/name>} $y_data - y_data_n]} {
                        set y_data_n [string map -nocase [list {"} {"} {&} {&} {<} {<} {>} {>}] $y_data_n]
                        regsub -all -nocase {[ ]{1,}} $y_data_n { } y_data_n
                } else {
                        putlog "YouTube: parsing error (<title>, $y_api$y_vid)"
                }

and it works
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

<nick> https://www.youtube.com/watch?v=g7ECDwBIvhw
<bot> Waka Flocka Flame - Flockaveli (full album) 2010 | I DO NOT OWN ANY OF THIS Copyright disclaimer under Section 107 of the Copyright Act 1976: allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted b... ( by Bisharoeli | 1:07:48 | 5.00 rating | 5 comments | 1,696 views | 4w 1d 3h 24m 7s ago )
http://ereader.kiczek.com/youtube.tcl
h
hayuto
Voice
Posts: 14
Joined: Tue May 28, 2013 6:52 pm

Post by hayuto »

lol i had the same script but in version 1.3, so many changes ;) thanks
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Is it possible to add color to the output of the script? Maybe I'm doing it wrong, but

Code: Select all

youtubeMsg privmsg $chan "\002\00301,00You\00300,04Tube\00399 [youtubeMap $n] ($rd)"
Is resulting in

Code: Select all

YouTube The Doors- Light My Fire (7:14)
With no color anywhere.


Details:
[11:28:40] YouTube 1.4: Loaded..
[11:28:40] YouTube 1.4: Http: 2.8.5;BotIsPatched: 1;EncodingSystem: utf-8;Tcl: 8.6;Eggdrop: 1.6.21;Suzi: NO

It does work with someone who has http 2.7.5, not patched, iso8859-1, and tcl 8.5
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Fixed by downloading an update. Appears (from what I understand) to be a bug in eggdrop that thommey's patch for UTF-8 exposes in stripcodes.
S
StormG
Voice
Posts: 9
Joined: Sat Jan 05, 2013 4:32 pm

Post by StormG »

speechles wrote:
<nick> https://www.youtube.com/watch?v=g7ECDwBIvhw
<bot> Waka Flocka Flame - Flockaveli (full album) 2010 | I DO NOT OWN ANY OF THIS Copyright disclaimer under Section 107 of the Copyright Act 1976: allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted b... ( by Bisharoeli | 1:07:48 | 5.00 rating | 5 comments | 1,696 views | 4w 1d 3h 24m 7s ago )
http://ereader.kiczek.com/youtube.tcl
Hello, is there a way for adding likes/dislikes to this script?
Post Reply