diff --git a/Gemfile b/Gemfile index 989feb122..a8bfb1661 100644 --- a/Gemfile +++ b/Gemfile @@ -22,20 +22,22 @@ gem 'jquery-rails' # Optional support for eco templates gem 'eco' -gem "omniauth" -gem "omniauth-twitter" -gem "omniauth-facebook" -gem "omniauth-linkedin" -gem "omniauth-google-oauth2" +gem 'omniauth' +gem 'omniauth-twitter' +gem 'omniauth-facebook' +gem 'omniauth-linkedin' +gem 'omniauth-google-oauth2' -gem "twitter" -gem "koala" -gem "mail" +gem 'twitter' +gem 'koala' +gem 'mail' -gem "mime-types" +gem 'mime-types' gem 'delayed_job_active_record' -gem "daemons" +gem 'daemons' + +gem 'simple-rss' # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 62dfe1f36..534e5616d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,6 +127,7 @@ GEM railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) + simple-rss (1.2.3) simple_oauth (0.1.5) sprockets (2.1.2) hike (~> 1.2) @@ -168,6 +169,7 @@ DEPENDENCIES omniauth-twitter rails (= 3.2.2) sass-rails (~> 3.2.4) + simple-rss sqlite3 twitter uglifier (>= 1.2.3) diff --git a/app/assets/javascripts/app/controllers/_dashboard/rss.js.coffee b/app/assets/javascripts/app/controllers/_dashboard/rss.js.coffee new file mode 100644 index 000000000..1636651cf --- /dev/null +++ b/app/assets/javascripts/app/controllers/_dashboard/rss.js.coffee @@ -0,0 +1,31 @@ +$ = jQuery.sub() + +class App.DashboardRss extends App.Controller + constructor: -> + super +# @log 'aaaa', @el + + @items = [] + + # get data + @ajax = new App.Ajax + @ajax.ajax( + type: 'GET', + url: '/rss_fetch', + data: { + limit: @limit, + url: @url, + } + processData: true, + success: (data, status, xhr) => + @items = data.items || [] + @render() + ) + + render: -> + html = App.view('dashboard/rss')( + head: @head, + items: @items + ) + html = $(html) + @html html diff --git a/app/assets/javascripts/app/controllers/dashboard.js.coffee b/app/assets/javascripts/app/controllers/dashboard.js.coffee index 7222706c1..f9c0ad82b 100644 --- a/app/assets/javascripts/app/controllers/dashboard.js.coffee +++ b/app/assets/javascripts/app/controllers/dashboard.js.coffee @@ -31,6 +31,23 @@ class Index extends App.Controller activity_stream: { controller: App.DashboardActivityStream, }, + rss_atom: { + controller: App.DashboardRss, + params: { + head: 'Heise ATOM', + url: 'http://www.heise.de/newsticker/heise-atom.xml', + limit: 5, + }, + }, +# rss_rdf: { +# controller: App.DashboardRss, +# params: { +# head: 'Heise RDF', +# url: 'http://www.heise.de/newsticker/heise.rdf', +# limit: 5, +# }, +# }, + # recent_viewed: { # controller: App.DashboardRecentViewed, # } diff --git a/app/assets/javascripts/app/views/dashboard/rss.jst.eco b/app/assets/javascripts/app/views/dashboard/rss.jst.eco new file mode 100644 index 000000000..1157b92a9 --- /dev/null +++ b/app/assets/javascripts/app/views/dashboard/rss.jst.eco @@ -0,0 +1,10 @@ +