The Youtube organizer

By slub77 on Apr 07, 2010

The Youtube organizer

1.Features: add your youtube video's, and check up on views when ever you want
2.Set groups for video's and job's to do
3.Selectable check boxes to mark your progress on video
4.Add notes to your video, and shout out to the channel
5.Add a link to your completed job

Link for a quick Preview
http://tinypic.com/player.php?v=1z49ue1&s=5
------------------------------------------

Job:
You add a video to it using the add button, aka add a title and link, then you click on the link in the list, or the title, in the drod down, then click UPDATE views aka what the sockread is for, then it grabs the latest view for that video

//////////////////Rate & Comment\\\\\\\\\\\

menu * {
  Youtube Dialog:/dialog -ma yt yt
}

dialog YT {
  title $+($me,'s) Youtube lay out
  size -1 -1 200 130
  option dbu
  text "//////////////////////////////The offical Youtubeing dialog\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\",1, 2 1 270 10
  tab Links, 2,1 10 197 118
  tab Projects,3
  tab Channels,26
  ;;;;;;;;;;;;;;;;;;;
  list 4,5 30 50 100,tab 2
  combo 5,55 30 140 10, drop,tab 2
  box Infomation,6,55 42 140 72,tab 2
  Text Views, 7,60 50 15 10,tab 2
  edit ,8,78 50 100 10,disable,center,tab 2
  button Update Views,9,60 60 130 10,tab 2
  edit ,10,60 70 130 40,tab 2, return, multi
  button Add, 22,60 115 50 10, tab 2
  ;;;;;;;;;;;;;;;
  combo 11,5 30 185 10,tab 3,drop
  list 12,5 50 50 70, tab 3
  edit ,13,57 50 140 20,tab 3
  edit , 15,57 100 130 10,tab 3,disable
  check Completed, 16,57 70 40 10,tab 3
  check Dismissed, 17,97 70 40 10,tab 3
  check In progress, 18,57 80 40 10,tab 3
  check Postponed, 19,97 80 40 10,tab 3
  check Awaiting Upload, 20,137 80 50 10,tab 3
  check Awaiting File, 21,137 70 50 10,tab 3
  Button Add Group, 23, 55 110 50 10,flat, tab 3
  Button Add Job, 24, 5 110 50 10, tab 3
  Button Shout!,25,120 115 50 10, tab 2
  ;;;;;;;;;;;;;;;;;;;;;;;;
  Edit ,27,5 30 100 10,tab 26
  Edit ,28,5 40 50 10,tab 26
  Edit ,29,5 50 50 10,tab 26
  Edit ,30,5 60 50 10,tab 26
  Edit ,31,5 70 50 10,tab 26
  button Get Infomation,32,5 80 50 10, tab 26
}

alias channelyou {
  set %channel.method dialog | set -u10 %name.y $did(27) 
  if $sock(poper) { sockclose poper }
  sockopen poper www.youtube.com 80 
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:sockopen:poper: {
  if (!$sockerr) { sockwrite -n poper GET $+(/,%name.y) HTTP/1.0 | sockwrite -n poper Host: www.youtube.com | sockwrite -n poper $crlf }
else { echo -st Socket Error: $sock(poper).mark | sockclose poper } }

on *:sockread:poper: {
  if ($sockerr) { echo -st Socket Error: $sock(poper).mark | sockclose poper }
  else { var %Youtube | sockread %Youtube 
    if ($regex(%Youtube,/<div style="float:right;" id="profile_show_viewed_count">(.+)</div>/)) { set %youtube.a $regml(1) }
    if ($regex(%Youtube,/<div style="float:right;" id="profile_show_first_name">(.+)</div>/)) { set %youtube.b $regml(1) }
    if ($regex(%Youtube,/<div style="float:right;" id="profile_show_last_login">(.+)</div>/)) { set %youtube.c $regml(1) }
    if ($regex(%Youtube,/<div style="float:right;" id="profile_show_subscriber_count">(.+)</div>/)) { set %youtube.d $regml(1) }
} }

on *:sockclose:poper:{
  if %channel.method == text {
    if %youtube.a { msg %channel  %name.y   Name:  %youtube.b  Views:  %youtube.a  Lasted logged in:  %youtube.c   Subscribers:  %youtube.d  OK? | unset %youtube.* }
    else { msg %channel Error 404:user name does not exsist }
  }

  if %channel.method == dialog {
    if %youtube.a { did -i yt 28 1 Name: %youtube.b  | did -i yt29 1 Views: %youtube.a  | did -i yt 30 1 Lasted logged in: %youtube.c | did -i yt 31 1 Subscribers: %youtube.d  | unset %youtube.* }
  else { echo -a Error 404:user name does not exsist } }
}

;;;;;;;;;;;;;;;;;;;;;;;;

on *:text:@yt *:#:{
  set -u10 %name.y $2 | set -u10 %channel $chan | set -u10 %channel.method text
  if $sock(poper) { sockclose poper }
  sockopen poper www.youtube.com 80 |sockmark poper $sock(poper).wserr $sock(poper).wsmsg
}

dialog Error {
  title ERROR INVALID URL
  size -1 -1 100 20
  option dbu
  text "Invalid URL, please retype the url and make sure it is a youtube vide link",1,1 1 100 30
}

on *:DIALOG:YT:INIT:*:{
  set %channel $active
  if $calc($ini(youtube.ini,link,0) +1) <= 1 { halt }
  else { 
    var %h 1 | var %p $calc($ini(youtube.ini,link,0) + 1)
    while (%h != %p) { did -o $dname 4 %h $+(%h,=,$readini(youtube.ini, link, %h)) | inc %h }
    var %h 1 | var %p $calc($ini(youtube.ini,title,0) + 1)
    while (%h != %p) { did -o $dname 5 %h $+(%h,=,$readini(youtube.ini, title, %h)) | inc %h }
  }
  if $calc($ini(youtube.ini,group,0) +1) <= 1 { noop }
  else {
    var %h 1 | var %p $calc($ini(youtube.ini,group,0) + 1)
    while (%h != %p) { did -o $dname 11 %h $+(%h,=,$readini(youtube.ini, group, %h)) | inc %h }
  }
  did -h $dname 24 | did -b $dname 12,13,15-21,24,25
}
on *:DIALOG:yt:SCLICK:*:{
  if $did == 22 { $addinglink }
  $checkbox
  if $did == 9 { set %youtube.method dialog | var %gettingl $right($did(4,0).seltext,$calc($len($did(4,0).seltext) -2)) | set %yt.link $remove(%gettingl,http://www.youtube.com) | $yt }
  if $did == 4 { did -c $dname 5 $left($did(4,0).seltext,1) | did -r $dname 10  | $rundata | did -e $dname 25 }
  if $did == 5 { did -c $dname 4 $left($did(5,0).seltext,1) | $rundata }
  if $did == 23 { $addgroup }
  if $did == 11 { did -v $dname 24 | did -r $dname 12  | did -e $dname 12,24 | $groupdetail  }
  if $did == 24 { $addgroupm  }
  if $did == 12 { did -e $dname 13,15-21 | $jobdetail | $jobinfo | $joblink }
  if $did == 25 { msg %channel Youtube Video: $did(5,0).seltext Link: $did(4,0).seltext user Infomation: $did(10) }
  if $did == 32 { $channelyou }
}
on *:DIALOG:yt:EDIT:*:{
  if $did == 10 { writeini youtube.ini notes $left($did(5,0).seltext,1) $did(10,0) }
  if $did == 13 { var %jj $left($did(12,0).seltext,1) | writeini youtube.ini $+(c,$left($did(11,0).seltext,1)) %jj $did(13) }
  if $did == 15 { var %jj $left($did(12,0).seltext,1) | writeini youtube.ini $+(d,$left($did(11,0).seltext,1)) %jj $did(15) }
}

alias joblink {
  did -r $dname 15 | $iif(!$readini(youtube.ini,$+(d,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)),noop,did -o $dname 15 1 $readini(youtube.ini,$+(d,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)))
}

alias -l groupdetail {
  if  $calc($ini(youtube.ini,$+(a,$left($did(11,0).seltext,1)),0) +1) <= 1 { noop }
  else {
    var %h 1 | var %p  $calc($ini(youtube.ini,$+(a,$left($did(11,0).seltext,1)),0) +1)
    while (%h != %p) { did -o $dname 12 %h $+(%h,=,$readini(youtube.ini,$+(a,$left($did(11,0).seltext,1)),%h)) | inc %h }
  }
}

alias jobdetail {
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 1 { did -u $dname 17-21 | did -c $dname 16 }
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 2 { did -u $dname 16,18-21 | did -c $dname 17 }
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 3 { did -u $dname 16,17,19,20,21 |  did -c $dname 18 }
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 4 { did -u $dname 16,17,18,20,21 |  did -c $dname 19 }
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 5 { did -u $dname 16-19,21 |  did -c $dname 20 }
  if $readini(youtube.ini,$+(b,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)) == 6 { did -u $dname 16-20 |  did -c $dname 21 }
}

alias jobinfo { did -r $dname 13 | $iif(!$readini(youtube.ini,$+(c,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1)),noop,did -o $dname 13 1 $readini(youtube.ini,$+(c,$left($did(11,0).seltext,1)),$left($did(12,0).seltext,1))) }

alias -l addgroupm { var %a $calc($ini(youtube.ini,$+(a,$left($did(11,0).seltext,1)),0) +1) | writeini youtube.ini $+(a,$left($did(11,0).seltext,1)) %a $?="Enter Job Name" | $reset }

alias addinglink { var %a $calc($ini(youtube.ini,link,0) +1) | var %b 1 | noop $?="Enter the title for the link" | writeini youtube.ini title %a $! | $iif(!$!,halt,writeini youtube.ini link %a $?="Enter Link") | $reset }

alias -l addgroup { var %a $calc($ini(youtube.ini,group,0) +1) | var %b 1 | writeini youtube.ini group %a $?="Enter Group Name") | $reset }

alias reset { var %a $dname | var %b $did | dialog -x %a %a | dialog -ma %a %a | $iif($did >= 11,did -fu 3)  }

alias -l checkbox {
  var %a $left($did(12,0).seltext,1)
  if $did == 16 { did -u $dname 17-21 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 1 }
  if $did == 17 { did -u $dname 16,18-21 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 2 }
  if $did == 18 { did -u $dname 16,17,19,20,21 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 3 }
  if $did == 19 { did -u $dname 16,17,18,20,21 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 4 }
  if $did == 20 { did -u $dname 16-19,21 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 5 }
  if $did == 21 { did -u $dname 16-20 | writeini youtube.ini $+(b,$left($did(11,0).seltext,1)) %a 6 }
}

alias -l rundata { did -o $dname 10 1 $readini(youtube.ini,notes,$left($did(5,0).seltext,1)) | did -o $dname 8 1 $readini(youtube.ini,view,$left($did(5,0).seltext,1)) }

*:TEXT:!yt*:#:{ set %yt.link $remove($2,http://www.youtube.com) | set %youtube.method msg | set %channel $chan | $yt }

alias -l yt {
  unset %youtube.d 
  if $sock(yt) { sockclose yt }
  sockopen yt www.youtube.com 80 
}

On *:sockopen:yt: {
  if (!$sockerr) { sockwrite -nt $sockname GET %yt.link HTTP/1.0 | sockwrite -n $sockname Host: www.youtube.com | sockwrite -n $sockname $crlf  }
  else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}

on *:sockread:yt: {
  if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  else {
    var %Youtube | sockread %Youtube 
    if ($regex(%Youtube,/<strong class="watch-view-count">(.*)</strong><br>views/)) { set %youtube.v $regml(1) }
    if ($regex(%Youtube,/<span class="watch-video-date">(.*)</span>/)) { set %youtube.d $regml(1) }
    if %youtube.v && %youtube.d && %youtube.method == msg { msg %channel Views: %youtube.v Date: %youtube.d | unset %youtube.d | unset %youtube.v }
    if %youtube.v && %youtube.d && %youtube.method == dialog { writeini youtube.ini view $left($did(yt,4,0).seltext,1) Views: %youtube.v Date: %youtube.d | did -o yt 8 1 Views: %youtube.v Date: %youtube.d | unset %youtube.d | unset %youtube.v }
  } 
}

Comments

Sign in to comment.
slub77   -  Apr 19, 2010

try it now

 Respond  
CadetAndrew   -  Apr 18, 2010
  • /writeini: insufficient parameters (line 77, youtube)
 Respond  
slub77   -  Apr 09, 2010

Job:
You add a video to it using the add button, aka add a title and link, then you click on the link in the list, or the title, in the drod down, then click UPDATE views aka what the sockread is for, then it grabs the latest view for that video

 Respond  
Dodge   -  Apr 08, 2010

it's like a sock read, write with a dialog stuffed on the top to do what. upload. i might be missing something... .. .

 Respond  
Dodge   -  Apr 08, 2010

I can't figure it. is it for ... .. .
bit of an explanation would be good. is it for

 Respond  
slub77   -  Apr 08, 2010

i know :D now like it >:

 Respond  
Jethro   -  Apr 07, 2010

Way to go...you've gone one step further to incorporate the use of socket into your lovable dialog. :p

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.