Vimeo URL Detector

By Vegito on Aug 25, 2014

Displays:

  • Title
  • Uploader
  • Likes
  • Plays
  • Description
  • Upload Date
  • Duration

$striphtml identifier is made by dJabba.

of posted url

Image

alias readXML {
  var %tag = $+(<,$1,>), %closingTag = $+(</,$1,>) 
  bread vimeo 0 $file(vimeo).size &binVar
  var %open = $bfind(&binVar, 0, %tag), %close = $bfind(&binVar, 0, %closingTag)

  return $bvar(&binVar, $calc(%open + $len(%tag)), $calc(%close - (%open + $len(%tag)))).text
}

alias htmlencode {
  var %str = $replace($1-,&amp;,&,&lt;,&#60;,&gt;,&#62;)
  var %str = $regsubex(%str,/&#(\d+?);/g,$chr(\1))
  var %str = $regsubex(%str,/&#x([\dA-F][\dA-F]);/g,$chr($base(\1,16,10)))
  return %str
}

on $*:text:/vimeo.com/(\d+)/Si:#:{
  if ($sock(vimeo)) .sockclose vimeo
  var -g %id = $regml(1), %msg = msg $target
  sockopen -e vimeo vimeo.com 443 
}

on *:input:*:{
  if ($regex($1, /vimeo.com/(\d+)/Si)) {
    if ($sock(vimeo)) .sockclose vimeo
    var -g %id = $regml(1), %msg = msg $target
    sockopen -e vimeo vimeo.com 443 
  }
}

on *:SOCKOPEN:vimeo: {
  sockwrite -nt $sockname GET /api/v2/video/ $+ %id $+ .xml http/1.0
  sockwrite -nt $sockname Host: vimeo.com
  sockwrite $sockname $crlf
}

on *:SOCKREAD:vimeo: {
  if ($sock($sockname).mark) {
    while ($sock($sockname).rq) {
      sockread &download_file
      .bwrite vimeo -1 -1 &download_file
    }
  }
  else {
    var %a
    sockread %a
    if (!%a) sockmark $sockname 1
  }
}

on *:SOCKCLOSE:vimeo: {
  var %title = $readXML(title), %upload_date = $readXML(upload_date), %description = $readXML(description), %likes = $readXML(stats_number_of_likes), %uploader = $readXML(user_name), %duration = $readXML(duration), %plays = $readXML(stats_number_of_plays) 

  %msg 8,1 -- Vimeo -- 9Title: 11 $+ $htmlencode(%title) 7 $+ $chr(124) 9By: 11 $+ %uploader 7 $+ $chr(124) 09On: 11 $+ $htmlencode(%upload_date) $iif(%description, 7 $+ $chr(124) 9Description: 11 $+ $v1,) $iif(%likes, 7 $+ $chr(124) 9Likes: 11 $+ $bytes($v1, b),) $&
    $iif(%plays, 7 $+ $chr(124) 9Plays: 11 $+ $bytes($v1, b),) 7 $+ $chr(124) 9Duration: 11 $+ $duration(%duration)

  .remove vimeo
}

Comments

Sign in to comment.
dma   -  Dec 25, 2015

dont work , and you need an account now with vimeo to view it

 Respond  
dma   -  Dec 16, 2015

this spits out a wall of spam like html

Vegito  -  Dec 29, 2015

I will look into it soon.

Sign in to comment

^WeSt   -  Aug 27, 2014

Uploader status does not display correct!

link: http://vimeo.com/86015819

also you can add total comments results and width and height results too.

  • Thanks!
Vegito  -  Aug 27, 2014

Updated the code :)

FevLoad  -  May 19, 2015

not working

[12:49pm] <~LIFE^> http://vimeo.com/86015819
[12:49pm] <@Yakoza> -- Vimeo -- Title: | By: | Likes: | Plays: | Comments: | Upload Date: | Duration: | Video Screen Size: xpx | Video Quality: |

if you could fix it , that would be appreciated

Vegito  -  Jun 28, 2015

Updated the code!

Sign in to comment

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.