Skip to content

Commit

Permalink
Support pscp.tv.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Dec 7, 2017
1 parent 5c97e6f commit 0fd7c79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app.rb
Expand Up @@ -34,7 +34,7 @@
redirect "/facebook?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?instagram\.com/ =~ params[:q]
redirect "/instagram?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?periscope\.tv/ =~ params[:q]
elsif /^https?:\/\/(?:www\.)?(?:periscope|pscp)\.tv/ =~ params[:q]
redirect "/periscope?#{params.to_querystring}"
elsif /^https?:\/\/(?:www\.)?soundcloud\.com/ =~ params[:q]
redirect "/soundcloud?#{params.to_querystring}"
Expand Down Expand Up @@ -617,10 +617,12 @@
get "/periscope" do
return "Insufficient parameters" if params[:q].empty?

if /periscope\.tv\/w\/(?<broadcast_id>[^\/?#]+)/ =~ params[:q]
if /(?:periscope|pscp)\.tv\/w\/(?<broadcast_id>[^\/?#]+)/ =~ params[:q]
# https://www.periscope.tv/w/1gqxvBmMZdexB
elsif /periscope\.tv\/(?<username>[^\/?#]+)/ =~ params[:q]
# https://www.pscp.tv/w/1gqxvBmMZdexB
elsif /(?:periscope|pscp)\.tv\/(?<username>[^\/?#]+)/ =~ params[:q]
# https://www.periscope.tv/jimmy_dore
# https://www.pscp.tv/jimmy_dore
else
username = params[:q]
end
Expand Down

0 comments on commit 0fd7c79

Please sign in to comment.