Skip to content

Commit

Permalink
RIP vid.me.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Dec 16, 2017
1 parent 96a9a02 commit 0733264
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 88 deletions.
38 changes: 0 additions & 38 deletions app.rb
Expand Up @@ -46,8 +46,6 @@
redirect "/speedrun?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?ustream\.tv/ =~ params[:q]
redirect "/ustream?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?vid\.me/ =~ params[:q]
redirect "/vidme?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?dailymotion\.com/ =~ params[:q]
redirect "/dailymotion?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?vimeo\.com/ =~ params[:q]
Expand Down Expand Up @@ -1017,42 +1015,6 @@
redirect url
end

get "/vidme" do
return "Insufficient parameters" if params[:q].empty?

if params[:q]["vid.me/c/"]
return "Unsupported url. Sorry."
elsif /vid\.me\/(?<id>[a-zA-Z0-9]+)/ =~ params[:q]
# https://vid.me/yvi
# https://vid.me/vidmelocker
else
id = params[:q]
end

response = Vidme.get("/videoByUrl/#{id}")
if response.success?
user = response.json["video"]["user"]
else
response = Vidme.get("/userByUsername/#{id}")
return "Could not find a user or video with the name #{id}. Sorry." if response.code == 400
raise(VidmeError, response) if !response.success?
user = response.json["user"]
end

redirect "/vidme/#{user["user_id"]}/#{user["username"]}"
end

get %r{/vidme/(?<user_id>[a-z0-9]+)/(?<username>.+)} do |user_id, username|
@user_id = user_id
@username = CGI.unescape(username)

response = Vidme.get("/user/#{user_id}/videos")
raise(VidmeError, response) if !response.success?
@data = response.json["videos"]

erb :vidme_feed
end

get "/dailymotion" do
return "Insufficient parameters" if params[:q].empty?

Expand Down
14 changes: 0 additions & 14 deletions app/vidme.rb

This file was deleted.

8 changes: 0 additions & 8 deletions views/index.erb
Expand Up @@ -188,14 +188,6 @@
</span>
</form>

<form class="input-group" method="get" action="vidme">
<div class="input-group-addon"><label for="vidme_q">Vidme</label></div>
<input class="form-control" type="search" name="q" id="vidme_q" placeholder="Enter a Vidme channel name or a url." required>
<span class="input-group-btn">
<input class="btn btn-primary" type="submit" value="Get RSS Feed">
</span>
</form>

<form class="input-group" method="get" action="dailymotion">
<div class="input-group-addon"><label for="dailymotion_q">Dailymotion</label></div>
<input class="form-control" type="search" name="q" id="dailymotion_q" placeholder="Enter a Dailymotion channel name or a url." required>
Expand Down
28 changes: 0 additions & 28 deletions views/vidme_feed.erb

This file was deleted.

0 comments on commit 0733264

Please sign in to comment.