jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2010
07:02 PM
tinyurl expansion?
Anyone have code for a tinyurl expander they could share, or perhaps explain to me how I might GET a full URL from a tiny one using BrightScript?
Thanks,
- Joel
Thanks,
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
5 REPLIES 5
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2010
07:08 PM
Re: tinyurl expansion?
I don't have code readily available, but you might be able to load the tiny url into an roUrlTransfer object, do a Head request, then check the "Location" header.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
RokuChris
Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2010
07:54 PM
Re: tinyurl expansion?
This is a function I wrote a while back to resolve redirected URLs. It relies on the ValidStr() function found in the file GeneralUtils.brs included with the SDK samples.
function NWM_ResolveRedirect(url)
result = url
done = false
ut = CreateObject("roURLTransfer")
ut.SetPort(CreateObject("roMessagePort"))
while not done
ut.SetURL(result)
if ut.AsyncHead()
while true
msg = wait(10000, ut.GetPort())
if msg <> invalid
h = msg.GetResponseHeaders()
if ValidStr(h.location) <> ""
result = ValidStr(h.location)
else
done = true
end if
else
done = true
end if
exit while
end while
else
done = true
end if
end while
return result
end function
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2010
08:59 PM
Re: tinyurl expansion?
Thanks Chris! I'll try this out. Idea is to grab Twitter postings that contain a URL that meets a certain criteria, and then determine URL of a media file based on that URL.
- Joel
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
mitesh_16sharma
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2012
05:22 AM
Re: tinyurl expansion?
Thanks RokuChris !!!
You saved my week !!
You saved my week !!
gskarma
Newbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024
10:42 AM
Re: tinyurl expansion? You can try etinyurl.com url expander
I don't have the code of the URL expander but, you can try etinyurl.com and its URL expander for expanding URLs for sure.