I am trying to parse the XML for Vimeo clips, so that I can populate the thumbnail, Title and description on an ASP page.

I can set the tartget to the Vimeo XML file, but cannot for the life of me get the actual content, let alsone isolate and use the various elements.

The XML generated for any clip is the same, here is an example:

<?xml version="1.0" encoding="utf-8"?>
<title>Crafty - short film</title>
A crafty housewife gets more than she bargained for when an activist shows up at her door. Starring Jenny Hagel and Amy Phillips.<br /> <br /> Screenings include Palm Springs International Shortfest, Nashville Film Festival, and Frameline: The San Francisco LGBT Film Festival<br /> Broadcast on The Logo Channel (MTV Networks)<br /> DVD release through Strand Releasing
<upload_date>2011-11-27 15:14:18</upload_date>
<user_name>Erik Gernand</user_name>
<tags>comedy, film, lesbian, activist</tags>

The code I use on a page, should be able to get all the bits and show a thumbnail of the clip, which will then become a link to a modal page which will then run the actual video.

The code I am trying to work with is as follows, which is on a test page to see if I can use both YouYube and Vimeo clips and the URL is checked to see if it contais "vimeo":


 ClipURL=Request("Clip") %>

  <% If (InStr(ClipURL,"vimeo"))<>0 Then 
response.Write("Vimeo Clip")

ClipID=Replace(ClipURL, "http://vimeo.com/", "")
' run the code to show the clip %>
  <br />
  <% XML_file ="http://vimeo.com/api/v2/video/"& ClipID&".xml" %><br />
  <%=XML_file  %> <a href="<%= XML_file %>" target="_blank">Link to the XML file</a><br />

 <br />

  <%' code snippet from existing example on DaniWeb - has not results
' Create new XML reader object
Dim xmlDoc
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
' Load the specified XML file (returns XML output)
xmlDoc.load("http://vimeo.com/api/v2/video/"& ClipID&".xml")
' Parse XML
if xmlDoc.parseError.errorcode <> 0 then
  ' oops error in xml
  Response.Write("XML Error...<br>")
  ' get xml data
end if

 <% 'Thumbnail from the XML file to display here %>

<br />

<iframe src="http://player.vimeo.com/video/<%= ClipID %>" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> 

So far I have had no luck at all with this and any assistance would be greatly appreciated.

Recommended Answers

All 2 Replies

Thank you ListMitch, this was most helpful. I have managed to get all the elements I need and it all works fine now.

Much appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.