egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding view count to youtube script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
hayuto
Voice


Joined: 28 May 2013
Posts: 14

PostPosted: Tue May 28, 2013 6:57 pm    Post subject: adding view count to youtube script Reply with quote

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 Razz i just read this scripts and fix them from time to time or translate but this is huge Very Happy 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!Very Happy

edit: and maybe other info too like who uploaded etc Surprised
Back to top
View user's profile Send private message
hayuto
Voice


Joined: 28 May 2013
Posts: 14

PostPosted: Thu May 30, 2013 1:55 pm    Post subject: Reply with quote

for youtuber name i added
Code:


                if {[regexp -nocase {<name>(.{1,})<\/name>} $y_data - y_data_n]} {
                        set y_data_n [string map -nocase [list {&quot;} {"} {&amp;} {&} {&lt;} {<} {&gt;} {>}] $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
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu May 30, 2013 3:55 pm    Post subject: Reply with quote

Quote:
<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
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
hayuto
Voice


Joined: 28 May 2013
Posts: 14

PostPosted: Fri May 31, 2013 2:31 am    Post subject: Reply with quote

lol i had the same script but in version 1.3, so many changes Wink thanks
Back to top
View user's profile Send private message
neocharles
Voice


Joined: 23 Apr 2013
Posts: 34

PostPosted: Fri Jul 26, 2013 8:37 am    Post subject: Reply with quote

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

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


Is resulting in
Code:
YouTube The Doors- Light My Fire (7:14)

With no color anywhere.


Details:
Quote:
[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
Back to top
View user's profile Send private message
neocharles
Voice


Joined: 23 Apr 2013
Posts: 34

PostPosted: Sat Jul 27, 2013 3:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
StormG
Voice


Joined: 05 Jan 2013
Posts: 9

PostPosted: Wed May 28, 2014 3:08 am    Post subject: Reply with quote

speechles wrote:
Quote:
<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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber