diff options
author | re4k <re4k@re4k.info> | 2013-03-26 17:54:34 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-03-26 17:55:13 +0900 |
commit | 9e05ce53b550ab05d06268bd0c2ae26ad294d0ab (patch) | |
tree | a431e3e1811e32e465a872c3ea9481106b83b2f7 /config/routes.rb | |
parent | 22b478cd66a419c30ab28471fbd495019810469e (diff) | |
download | aclog-9e05ce53b550ab05d06268bd0c2ae26ad294d0ab.tar.gz |
Add favs_from/rts_from
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/config/routes.rb b/config/routes.rb index 3b65357..1d697db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,29 +5,36 @@ Aclog::Application.routes.draw do :screen_name => /[a-zA-Z0-9_]{1,20}/, :page => /[0-9]+/, :count => /[0-9]+/, - :tweets => /(all|favorite|retweet)/ + :tweets => /(all|fav(orite[sd]?|(or)?ed|s)?|re?t(weet(s|ed)?|s)?)/, + :order => /(fav(orite[sd]?|(or)?ed|s)?|re?t(weet(s|ed)?|s)?)/, } root :to => "main#index" + # internals + get "/i" => redirect("/") get "/i/callback" => "sessions#callback" get "/i/logout" => "sessions#destroy" + # other + get "/i/show" => "i#show", :constraints => constraints + get "/i/best" => "i#best" get "/i/recent" => "i#recent" + get "/i/timeline" => "i#timeline" + get "/i/:id" => "i#show", :constraints => constraints - get "/i/show" => "i#show", :constraints => constraints + # user get "/users/best" => "users#best", :constraints => constraints get "/users/recent" => "users#recent", :constraints => constraints get "/users/timeline" => "users#timeline", :constraints => constraints get "/users/discovered" => "users#discovered", :constraints => constraints - get "/i/:id" => "i#show", :constraints => constraints - get "/:screen_name(/:page)" => "users#best", :constraints => constraints - get "/:screen_name/best" => redirect("/%{screen_name}") + get "/:screen_name/:order(/:page)" => "users#best", :constraints => constraints get "/:screen_name/recent(/:page)" => "users#recent", :constraints => constraints + get "/:screen_name/recent/:order(/:page)" => "users#recent", :constraints => constraints get "/:screen_name/timeline(/:page)" => "users#timeline", :constraints => constraints get "/:screen_name/timeline/:tweets(/:page)" => "users#timeline", :constraints => constraints @@ -35,6 +42,11 @@ Aclog::Application.routes.draw do get "/:screen_name/discovered(/:page)" => "users#discovered", :constraints => constraints get "/:screen_name/discovered/:tweets(/:page)" => "users#discovered", :constraints => constraints + get "/:screen_name/info" => "users#info", :constraints => constraints + get "/:screen_name/favs_from" => "users#from", :constraints => constraints, :defaults => {:event => "favorite"} + get "/:screen_name/rts_from" => "users#from", :constraints => constraints, :defaults => {:event => "retweet"} + + # redirects get "/(users)/:screen_name/status(es)/:id" => redirect("/i/%{id}") get "/users/:screen_name" => redirect("/%{screen_name}") get "/users/:screen_name/discovered" => redirect("/%{screen_name}/discovered") |