muck-services 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +100 -0
- data/Rakefile +84 -0
- data/VERSION +1 -0
- data/app/controllers/admin/muck/feeds_controller.rb +40 -0
- data/app/controllers/admin/muck/oai_endpoints_controller.rb +13 -0
- data/app/controllers/muck/aggregation_feeds_controller.rb +43 -0
- data/app/controllers/muck/aggregations_controller.rb +234 -0
- data/app/controllers/muck/entries_controller.rb +102 -0
- data/app/controllers/muck/feed_previews_controller.rb +33 -0
- data/app/controllers/muck/feeds_controller.rb +157 -0
- data/app/controllers/muck/identity_feeds_controller.rb +155 -0
- data/app/controllers/muck/oai_endpoints_controller.rb +96 -0
- data/app/controllers/muck/recommendations_controller.rb +62 -0
- data/app/controllers/muck/topics_controller.rb +162 -0
- data/app/controllers/muck/visits_controller.rb +26 -0
- data/app/helpers/muck_services_aggregations_helper.rb +32 -0
- data/app/helpers/muck_services_feeds_helper.rb +32 -0
- data/app/helpers/muck_services_helper.rb +95 -0
- data/app/helpers/muck_services_service_helper.rb +117 -0
- data/app/models/aggregation.rb +92 -0
- data/app/models/aggregation_feed.rb +14 -0
- data/app/models/attention.rb +14 -0
- data/app/models/click.rb +14 -0
- data/app/models/entry.rb +341 -0
- data/app/models/feed.rb +224 -0
- data/app/models/feed_parent.rb +18 -0
- data/app/models/identity_feed.rb +26 -0
- data/app/models/oai_endpoint.rb +39 -0
- data/app/models/recommendation.rb +15 -0
- data/app/models/service.rb +486 -0
- data/app/models/service_category.rb +15 -0
- data/app/models/services_mailer.rb +25 -0
- data/app/models/subject.rb +10 -0
- data/app/models/tag_cloud.rb +21 -0
- data/app/views/activity_templates/_entry_comment.html.erb +8 -0
- data/app/views/activity_templates/_entry_share.html.erb +8 -0
- data/app/views/admin/feeds/index.html.erb +35 -0
- data/app/views/admin/oai_endpoints/index.html.erb +31 -0
- data/app/views/aggregations/_aggregation.html.erb +1 -0
- data/app/views/aggregations/_data_source.html.erb +4 -0
- data/app/views/aggregations/_data_sources.html.erb +10 -0
- data/app/views/aggregations/_feeds.html.erb +1 -0
- data/app/views/aggregations/_preview_form.html.erb +12 -0
- data/app/views/aggregations/edit.html.erb +65 -0
- data/app/views/aggregations/index.html.erb +17 -0
- data/app/views/aggregations/index.iphone.erb +0 -0
- data/app/views/aggregations/new.html.erb +12 -0
- data/app/views/aggregations/preview.html.erb +46 -0
- data/app/views/aggregations/preview.iphone.erb +0 -0
- data/app/views/aggregations/rss_discovery.html.erb +3 -0
- data/app/views/aggregations/show.html.erb +0 -0
- data/app/views/default/_language_list.html.erb +5 -0
- data/app/views/entries/_related_entry.html.erb +4 -0
- data/app/views/entries/_result.html.erb +7 -0
- data/app/views/entries/_result_status.html.erb +16 -0
- data/app/views/entries/_results.html.erb +3 -0
- data/app/views/entries/_tag_cloud.html.erb +18 -0
- data/app/views/entries/browse_by_tags.html.erb +16 -0
- data/app/views/entries/collections.html.erb +28 -0
- data/app/views/entries/details.html.erb +25 -0
- data/app/views/entries/index.html.erb +3 -0
- data/app/views/entries/search.html.erb +10 -0
- data/app/views/entries/show.html.erb +7 -0
- data/app/views/entries/track_clicks.html.erb +0 -0
- data/app/views/feed_previews/new.html.erb +1 -0
- data/app/views/feed_previews/select_feeds.html.erb +6 -0
- data/app/views/feeds/_entry.html.erb +1 -0
- data/app/views/feeds/_feed.html.erb +28 -0
- data/app/views/feeds/_feed_row.html.erb +29 -0
- data/app/views/feeds/_feed_selection.html.erb +1 -0
- data/app/views/feeds/_form.html.erb +20 -0
- data/app/views/feeds/edit.html.erb +107 -0
- data/app/views/feeds/harvest_now.html.erb +3 -0
- data/app/views/feeds/index.html.erb +34 -0
- data/app/views/feeds/new.html.erb +21 -0
- data/app/views/feeds/new_extended.html.erb +32 -0
- data/app/views/feeds/new_oai_rss.html.erb +50 -0
- data/app/views/feeds/show.html.erb +1 -0
- data/app/views/feeds/unban.html.erb +3 -0
- data/app/views/identity_feeds/_available_service_categories.html.erb +13 -0
- data/app/views/identity_feeds/_form.html.erb +20 -0
- data/app/views/identity_feeds/_services_for_user.html.erb +25 -0
- data/app/views/identity_feeds/edit.html.erb +2 -0
- data/app/views/identity_feeds/index.html.erb +32 -0
- data/app/views/identity_feeds/new.html.erb +1 -0
- data/app/views/oai_endpoints/_form.html.erb +22 -0
- data/app/views/oai_endpoints/_oai_endpoint_row.html.erb +25 -0
- data/app/views/oai_endpoints/new.html.erb +2 -0
- data/app/views/oai_endpoints/show.html.erb +5 -0
- data/app/views/parts/_add_feed.html.erb +20 -0
- data/app/views/parts/_select_feed.html.erb +4 -0
- data/app/views/recommendations/index.html.erb +5 -0
- data/app/views/recommendations/index.pjs.erb +44 -0
- data/app/views/recommendations/index.rss.builder +37 -0
- data/app/views/recommendations/index.xml.builder +36 -0
- data/app/views/recommendations/index_js.pjs.erb +39 -0
- data/app/views/recommendations/index_real_time.pjs.erb +44 -0
- data/app/views/recommendations/index_real_time.xml.builder +25 -0
- data/app/views/search/_languages.html.erb +6 -0
- data/app/views/search/_result.html.erb +9 -0
- data/app/views/search/_search_box.html.erb +9 -0
- data/app/views/search/index.html.erb +5 -0
- data/app/views/search/results.atom.builder +27 -0
- data/app/views/search/results.html.erb +35 -0
- data/app/views/search/results.pjs.erb +13 -0
- data/app/views/search/results.rdf.builder +24 -0
- data/app/views/search/results.rss.builder +31 -0
- data/app/views/search/results.xml.builder +19 -0
- data/app/views/service_templates/_facebook.html.erb +4 -0
- data/app/views/service_templates/_friendfeed.html.erb +2 -0
- data/app/views/service_templates/_goodreads.html.erb +2 -0
- data/app/views/service_templates/_linkedin.html.erb +2 -0
- data/app/views/service_templates/_netflix.html.erb +2 -0
- data/app/views/service_templates/_polyvore.html.erb +2 -0
- data/app/views/service_templates/_zotero_group.html.erb +2 -0
- data/app/views/services/_edit_service.html.erb +1 -0
- data/app/views/services/_new_service.html.erb +1 -0
- data/app/views/services/_summary.html.erb +5 -0
- data/app/views/services/_view_service.html.erb +1 -0
- data/app/views/services_mailer/notification_feed_added.text.ar.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ar.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.bg.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.bg.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.ca.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ca.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.cs.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.cs.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.da.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.da.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.de.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.de.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.el.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.el.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.es.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.es.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.et.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.et.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.fa.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.fa.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.fi.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.fi.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.fr.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.fr.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.gl.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.gl.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.hi.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.hi.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.hr.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.hr.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.hu.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.hu.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.id.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.id.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.it.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.it.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.iw.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.iw.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.ja.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ja.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.ko.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ko.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.lt.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.lt.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.lv.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.lv.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.mt.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.mt.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.nl.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.nl.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.no.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.no.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.pl.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.pl.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.ro.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ro.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.ru.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.ru.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.sk.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.sk.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.sl.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.sl.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.sq.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.sq.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.sr.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.sr.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.sv.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.sv.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.th.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.th.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.tl.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.tl.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.tr.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.tr.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.uk.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.uk.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.vi.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.vi.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.plain.erb +7 -0
- data/app/views/services_mailer/notification_feed_added.text.zh.html.erb +4 -0
- data/app/views/services_mailer/notification_feed_added.text.zh.plain.erb +7 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.plain.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.html.erb +4 -0
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.plain.erb +4 -0
- data/app/views/topics/_entry.html.erb +19 -0
- data/app/views/topics/_feed.html.erb +24 -0
- data/app/views/topics/_feed_preview.html.erb +18 -0
- data/app/views/topics/_form.html.erb +15 -0
- data/app/views/topics/_rss_discover.html.erb +1 -0
- data/app/views/topics/_simple_entry.html.erb +7 -0
- data/app/views/topics/new.html.erb +27 -0
- data/app/views/topics/photos.html.erb +14 -0
- data/app/views/topics/show.html.erb +80 -0
- data/app/views/topics/show.opml.builder +18 -0
- data/app/views/topics/videos.html.erb +14 -0
- data/app/views/visits/_comments_tool.html.erb +19 -0
- data/app/views/visits/_frame_scripts.html.erb +26 -0
- data/app/views/visits/_share_tool.html.erb +22 -0
- data/app/views/visits/_toolbar.html.erb +25 -0
- data/app/views/visits/show.html.erb +7 -0
- data/config/muck_services_routes.rb +37 -0
- data/config/solr/README.txt +0 -0
- data/config/solr/cores/de/conf/protwords.txt +21 -0
- data/config/solr/cores/de/conf/schema.xml +81 -0
- data/config/solr/cores/de/conf/solrconfig.xml +311 -0
- data/config/solr/cores/de/conf/stopwords.txt +341 -0
- data/config/solr/cores/de/conf/synonyms.txt +31 -0
- data/config/solr/cores/en/conf/protwords.txt +21 -0
- data/config/solr/cores/en/conf/schema.xml +83 -0
- data/config/solr/cores/en/conf/solrconfig.xml +311 -0
- data/config/solr/cores/en/conf/stopwords.txt +341 -0
- data/config/solr/cores/en/conf/synonyms.txt +31 -0
- data/config/solr/cores/es/conf/protwords.txt +21 -0
- data/config/solr/cores/es/conf/schema.xml +81 -0
- data/config/solr/cores/es/conf/solrconfig.xml +311 -0
- data/config/solr/cores/es/conf/stopwords.txt +206 -0
- data/config/solr/cores/es/conf/synonyms.txt +31 -0
- data/config/solr/cores/fr/conf/protwords.txt +21 -0
- data/config/solr/cores/fr/conf/schema.xml +82 -0
- data/config/solr/cores/fr/conf/solrconfig.xml +311 -0
- data/config/solr/cores/fr/conf/stopwords.txt +57 -0
- data/config/solr/cores/fr/conf/synonyms.txt +31 -0
- data/config/solr/cores/ja/conf/protwords.txt +21 -0
- data/config/solr/cores/ja/conf/schema.xml +69 -0
- data/config/solr/cores/ja/conf/solrconfig.xml +311 -0
- data/config/solr/cores/ja/conf/stopwords.txt +341 -0
- data/config/solr/cores/ja/conf/synonyms.txt +31 -0
- data/config/solr/cores/nl/conf/protwords.txt +21 -0
- data/config/solr/cores/nl/conf/schema.xml +78 -0
- data/config/solr/cores/nl/conf/solrconfig.xml +311 -0
- data/config/solr/cores/nl/conf/stopwords.txt +45691 -0
- data/config/solr/cores/nl/conf/synonyms.txt +31 -0
- data/config/solr/cores/ru/conf/protwords.txt +21 -0
- data/config/solr/cores/ru/conf/schema.xml +78 -0
- data/config/solr/cores/ru/conf/solrconfig.xml +311 -0
- data/config/solr/cores/ru/conf/stopwords.txt +341 -0
- data/config/solr/cores/ru/conf/synonyms.txt +31 -0
- data/config/solr/cores/zh/conf/protwords.txt +21 -0
- data/config/solr/cores/zh/conf/schema.xml +72 -0
- data/config/solr/cores/zh/conf/solrconfig.xml +311 -0
- data/config/solr/cores/zh/conf/stopwords.txt +341 -0
- data/config/solr/cores/zh/conf/synonyms.txt +31 -0
- data/config/solr/solr.xml +50 -0
- data/db/bootstrap/attention.yml +6 -0
- data/db/bootstrap/feeds.yml +4268 -0
- data/db/bootstrap/oai_endpoints.yml +6 -0
- data/db/bootstrap/service_categories.yml +52 -0
- data/db/bootstrap/services.yml +967 -0
- data/db/migrate/20090602191243_create_muck_raker.rb +322 -0
- data/db/migrate/20090619211125_create_tag_clouds.rb +19 -0
- data/db/migrate/20090623181458_add_grain_size_to_entries.rb +16 -0
- data/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
- data/db/migrate/20090703175825_denormalize_entries_subjects.rb +39 -0
- data/db/migrate/20090704220055_create_slugs.rb +18 -0
- data/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +9 -0
- data/db/migrate/20090717173900_add_contributor_to_feeds.rb +9 -0
- data/db/migrate/20090717175825_normalize_entries_subjects.rb +41 -0
- data/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
- data/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
- data/db/migrate/20090723050510_create_feed_parents.rb +17 -0
- data/db/migrate/20090728165716_add_etag_to_feeds.rb +9 -0
- data/db/migrate/20090730045848_add_comment_cache_to_entries.rb +9 -0
- data/db/migrate/20090804211240_add_entry_id_to_shares.rb +9 -0
- data/db/migrate/20090826220530_change_services_sequence_to_sort.rb +9 -0
- data/db/migrate/20090826225652_create_identity_feeds.rb +14 -0
- data/db/migrate/20090827005105_add_identity_fields_to_services.rb +13 -0
- data/db/migrate/20090827015308_create_service_categories.rb +12 -0
- data/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +11 -0
- data/db/migrate/20090915041650_aggregations_to_polymorphic.rb +15 -0
- data/db/migrate/20090922174200_update_oai_endpoints.rb +13 -0
- data/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +11 -0
- data/db/migrate/20090923150807_rename_name_in_aggregation.rb +9 -0
- data/db/migrate/20090924200750_add_uri_data_template_to_services.rb +9 -0
- data/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +9 -0
- data/db/migrate/20091022150615_add_uri_key_to_services.rb +9 -0
- data/lib/active_record/acts/muck_aggregation_owner.rb +30 -0
- data/lib/active_record/acts/muck_feed_owner.rb +31 -0
- data/lib/active_record/acts/muck_feed_parent.rb +23 -0
- data/lib/active_record/acts/muck_services_comment.rb +39 -0
- data/lib/active_record/acts/muck_services_share.rb +32 -0
- data/lib/muck_services.rb +21 -0
- data/lib/muck_services/exceptions.rb +5 -0
- data/lib/muck_services/initialize_routes.rb +8 -0
- data/lib/muck_services/languages.rb +57 -0
- data/lib/muck_services/muck_custom_form_builder.rb +22 -0
- data/lib/muck_services/services.rb +12 -0
- data/lib/muck_services/tasks.rb +97 -0
- data/locales/ar.yml +210 -0
- data/locales/bg.yml +210 -0
- data/locales/ca.yml +210 -0
- data/locales/cs.yml +210 -0
- data/locales/da.yml +210 -0
- data/locales/de.yml +210 -0
- data/locales/el.yml +210 -0
- data/locales/en.yml +213 -0
- data/locales/es.yml +210 -0
- data/locales/et.yml +210 -0
- data/locales/fa.yml +210 -0
- data/locales/fi.yml +210 -0
- data/locales/fr.yml +210 -0
- data/locales/gl.yml +210 -0
- data/locales/hi.yml +210 -0
- data/locales/hr.yml +210 -0
- data/locales/hu.yml +210 -0
- data/locales/id.yml +210 -0
- data/locales/it.yml +210 -0
- data/locales/iw.yml +210 -0
- data/locales/ja.yml +210 -0
- data/locales/ko.yml +210 -0
- data/locales/lt.yml +210 -0
- data/locales/lv.yml +210 -0
- data/locales/mt.yml +210 -0
- data/locales/nl.yml +210 -0
- data/locales/no.yml +211 -0
- data/locales/pl.yml +210 -0
- data/locales/pt-PT.yml +210 -0
- data/locales/ro.yml +210 -0
- data/locales/ru.yml +210 -0
- data/locales/sk.yml +210 -0
- data/locales/sl.yml +210 -0
- data/locales/sq.yml +210 -0
- data/locales/sr.yml +210 -0
- data/locales/sv.yml +210 -0
- data/locales/th.yml +210 -0
- data/locales/tl.yml +210 -0
- data/locales/tr.yml +210 -0
- data/locales/uk.yml +210 -0
- data/locales/vi.yml +210 -0
- data/locales/zh-CN.yml +210 -0
- data/locales/zh-TW.yml +210 -0
- data/locales/zh.yml +210 -0
- data/muck-services.gemspec +891 -0
- data/public/images/service_icons/16/amazon.png +0 -0
- data/public/images/service_icons/16/ask.png +0 -0
- data/public/images/service_icons/16/bibsonomy.png +0 -0
- data/public/images/service_icons/16/bing.png +0 -0
- data/public/images/service_icons/16/blogger.png +0 -0
- data/public/images/service_icons/16/bloglines.png +0 -0
- data/public/images/service_icons/16/citeulike.png +0 -0
- data/public/images/service_icons/16/clipmarks.png +0 -0
- data/public/images/service_icons/16/connotea.png +0 -0
- data/public/images/service_icons/16/dailymotion.png +0 -0
- data/public/images/service_icons/16/delicious.png +0 -0
- data/public/images/service_icons/16/digg.png +0 -0
- data/public/images/service_icons/16/diigo.png +0 -0
- data/public/images/service_icons/16/facebook.png +0 -0
- data/public/images/service_icons/16/feed.png +0 -0
- data/public/images/service_icons/16/flickr.png +0 -0
- data/public/images/service_icons/16/fotolog.png +0 -0
- data/public/images/service_icons/16/friendfeed.png +0 -0
- data/public/images/service_icons/16/friendster.png +0 -0
- data/public/images/service_icons/16/furl.png +0 -0
- data/public/images/service_icons/16/goodreads.png +0 -0
- data/public/images/service_icons/16/google.png +0 -0
- data/public/images/service_icons/16/googleblog.png +0 -0
- data/public/images/service_icons/16/googlenews.png +0 -0
- data/public/images/service_icons/16/icerocket.png +0 -0
- data/public/images/service_icons/16/identica.png +0 -0
- data/public/images/service_icons/16/joost.png +0 -0
- data/public/images/service_icons/16/lastfm.png +0 -0
- data/public/images/service_icons/16/librarything.png +0 -0
- data/public/images/service_icons/16/linkedin.png +0 -0
- data/public/images/service_icons/16/livejournal.png +0 -0
- data/public/images/service_icons/16/magnolia.png +0 -0
- data/public/images/service_icons/16/mendeley.png +0 -0
- data/public/images/service_icons/16/metacafe.png +0 -0
- data/public/images/service_icons/16/mixx.png +0 -0
- data/public/images/service_icons/16/myspace.png +0 -0
- data/public/images/service_icons/16/netflix.png +0 -0
- data/public/images/service_icons/16/netvibes.png +0 -0
- data/public/images/service_icons/16/newsvine.png +0 -0
- data/public/images/service_icons/16/oai.png +0 -0
- data/public/images/service_icons/16/odeo.png +0 -0
- data/public/images/service_icons/16/opml.png +0 -0
- data/public/images/service_icons/16/pandora.png +0 -0
- data/public/images/service_icons/16/photobucket.png +0 -0
- data/public/images/service_icons/16/picasa.png +0 -0
- data/public/images/service_icons/16/polyvore.png +0 -0
- data/public/images/service_icons/16/pownce.png +0 -0
- data/public/images/service_icons/16/reddit.png +0 -0
- data/public/images/service_icons/16/simpy.png +0 -0
- data/public/images/service_icons/16/smugmug.png +0 -0
- data/public/images/service_icons/16/stumbleupon.png +0 -0
- data/public/images/service_icons/16/tag.png +0 -0
- data/public/images/service_icons/16/technorati.png +0 -0
- data/public/images/service_icons/16/tumblr.png +0 -0
- data/public/images/service_icons/16/twine.png +0 -0
- data/public/images/service_icons/16/twitter.png +0 -0
- data/public/images/service_icons/16/vimeo.png +0 -0
- data/public/images/service_icons/16/webshots.png +0 -0
- data/public/images/service_icons/16/wordpress.png +0 -0
- data/public/images/service_icons/16/xanga.png +0 -0
- data/public/images/service_icons/16/yahoo.png +0 -0
- data/public/images/service_icons/16/yelp.png +0 -0
- data/public/images/service_icons/16/youtube.png +0 -0
- data/public/images/service_icons/16/zooomr.png +0 -0
- data/public/images/service_icons/16/zotero.png +0 -0
- data/public/images/service_icons/24/amazon.png +0 -0
- data/public/images/service_icons/24/ask.png +0 -0
- data/public/images/service_icons/24/bibsonomy.png +0 -0
- data/public/images/service_icons/24/bing.png +0 -0
- data/public/images/service_icons/24/blogger.png +0 -0
- data/public/images/service_icons/24/bloglines.png +0 -0
- data/public/images/service_icons/24/citeulike.png +0 -0
- data/public/images/service_icons/24/clipmarks.png +0 -0
- data/public/images/service_icons/24/connotea.png +0 -0
- data/public/images/service_icons/24/dailymotion.png +0 -0
- data/public/images/service_icons/24/delicious.png +0 -0
- data/public/images/service_icons/24/digg.png +0 -0
- data/public/images/service_icons/24/diigo.png +0 -0
- data/public/images/service_icons/24/facebook.png +0 -0
- data/public/images/service_icons/24/feed.png +0 -0
- data/public/images/service_icons/24/flickr.png +0 -0
- data/public/images/service_icons/24/fotolog.png +0 -0
- data/public/images/service_icons/24/friendfeed.png +0 -0
- data/public/images/service_icons/24/friendster.png +0 -0
- data/public/images/service_icons/24/furl.png +0 -0
- data/public/images/service_icons/24/goodreads.png +0 -0
- data/public/images/service_icons/24/google.png +0 -0
- data/public/images/service_icons/24/googleblog.png +0 -0
- data/public/images/service_icons/24/googlenews.png +0 -0
- data/public/images/service_icons/24/icerocket.png +0 -0
- data/public/images/service_icons/24/identica.png +0 -0
- data/public/images/service_icons/24/joost.png +0 -0
- data/public/images/service_icons/24/lastfm.png +0 -0
- data/public/images/service_icons/24/librarything.png +0 -0
- data/public/images/service_icons/24/linkedin.png +0 -0
- data/public/images/service_icons/24/livejournal.png +0 -0
- data/public/images/service_icons/24/magnolia.png +0 -0
- data/public/images/service_icons/24/mendeley.png +0 -0
- data/public/images/service_icons/24/metacafe.png +0 -0
- data/public/images/service_icons/24/mixx.png +0 -0
- data/public/images/service_icons/24/myspace.png +0 -0
- data/public/images/service_icons/24/netflix.png +0 -0
- data/public/images/service_icons/24/netvibes.png +0 -0
- data/public/images/service_icons/24/newsvine.png +0 -0
- data/public/images/service_icons/24/oai.png +0 -0
- data/public/images/service_icons/24/odeo.png +0 -0
- data/public/images/service_icons/24/opml.png +0 -0
- data/public/images/service_icons/24/pandora.png +0 -0
- data/public/images/service_icons/24/photobucket.png +0 -0
- data/public/images/service_icons/24/picasa.png +0 -0
- data/public/images/service_icons/24/polyvore.png +0 -0
- data/public/images/service_icons/24/pownce.png +0 -0
- data/public/images/service_icons/24/reddit.png +0 -0
- data/public/images/service_icons/24/simpy.png +0 -0
- data/public/images/service_icons/24/smugmug.png +0 -0
- data/public/images/service_icons/24/stumbleupon.png +0 -0
- data/public/images/service_icons/24/tag.png +0 -0
- data/public/images/service_icons/24/technorati.png +0 -0
- data/public/images/service_icons/24/tumblr.png +0 -0
- data/public/images/service_icons/24/twine.png +0 -0
- data/public/images/service_icons/24/twitter.png +0 -0
- data/public/images/service_icons/24/vimeo.png +0 -0
- data/public/images/service_icons/24/webshots.png +0 -0
- data/public/images/service_icons/24/wordpress.png +0 -0
- data/public/images/service_icons/24/xanga.png +0 -0
- data/public/images/service_icons/24/yahoo.png +0 -0
- data/public/images/service_icons/24/yelp.png +0 -0
- data/public/images/service_icons/24/youtube.png +0 -0
- data/public/images/service_icons/24/zooomr.png +0 -0
- data/public/images/service_icons/24/zotero.png +0 -0
- data/public/images/service_icons/48/amazon.png +0 -0
- data/public/images/service_icons/48/ask.png +0 -0
- data/public/images/service_icons/48/bibsonomy.png +0 -0
- data/public/images/service_icons/48/bing.png +0 -0
- data/public/images/service_icons/48/blogger.png +0 -0
- data/public/images/service_icons/48/bloglines.png +0 -0
- data/public/images/service_icons/48/citeulike.png +0 -0
- data/public/images/service_icons/48/clipmarks.png +0 -0
- data/public/images/service_icons/48/connotea.png +0 -0
- data/public/images/service_icons/48/dailymotion.png +0 -0
- data/public/images/service_icons/48/delicious.png +0 -0
- data/public/images/service_icons/48/digg.png +0 -0
- data/public/images/service_icons/48/diigo.png +0 -0
- data/public/images/service_icons/48/facebook.png +0 -0
- data/public/images/service_icons/48/feed.png +0 -0
- data/public/images/service_icons/48/flickr.png +0 -0
- data/public/images/service_icons/48/fotolog.png +0 -0
- data/public/images/service_icons/48/friendfeed.png +0 -0
- data/public/images/service_icons/48/friendster.png +0 -0
- data/public/images/service_icons/48/furl.png +0 -0
- data/public/images/service_icons/48/goodreads.png +0 -0
- data/public/images/service_icons/48/google.png +0 -0
- data/public/images/service_icons/48/googleblog.png +0 -0
- data/public/images/service_icons/48/googlenews.png +0 -0
- data/public/images/service_icons/48/icerocket.png +0 -0
- data/public/images/service_icons/48/identica.png +0 -0
- data/public/images/service_icons/48/joost.png +0 -0
- data/public/images/service_icons/48/lastfm.png +0 -0
- data/public/images/service_icons/48/librarything.png +0 -0
- data/public/images/service_icons/48/linkedin.png +0 -0
- data/public/images/service_icons/48/livejournal.png +0 -0
- data/public/images/service_icons/48/magnolia.png +0 -0
- data/public/images/service_icons/48/mendeley.png +0 -0
- data/public/images/service_icons/48/metacafe.png +0 -0
- data/public/images/service_icons/48/mixx.png +0 -0
- data/public/images/service_icons/48/myspace.png +0 -0
- data/public/images/service_icons/48/netflix.png +0 -0
- data/public/images/service_icons/48/netvibes.png +0 -0
- data/public/images/service_icons/48/newsvine.png +0 -0
- data/public/images/service_icons/48/oai.png +0 -0
- data/public/images/service_icons/48/odeo.png +0 -0
- data/public/images/service_icons/48/opml.png +0 -0
- data/public/images/service_icons/48/pandora.png +0 -0
- data/public/images/service_icons/48/photobucket.png +0 -0
- data/public/images/service_icons/48/picasa.png +0 -0
- data/public/images/service_icons/48/polyvore.png +0 -0
- data/public/images/service_icons/48/pownce.png +0 -0
- data/public/images/service_icons/48/reddit.png +0 -0
- data/public/images/service_icons/48/simpy.png +0 -0
- data/public/images/service_icons/48/smugmug.png +0 -0
- data/public/images/service_icons/48/stumbleupon.png +0 -0
- data/public/images/service_icons/48/tag.png +0 -0
- data/public/images/service_icons/48/technorati.png +0 -0
- data/public/images/service_icons/48/tumblr.png +0 -0
- data/public/images/service_icons/48/twine.png +0 -0
- data/public/images/service_icons/48/twitter.png +0 -0
- data/public/images/service_icons/48/vimeo.png +0 -0
- data/public/images/service_icons/48/webshots.png +0 -0
- data/public/images/service_icons/48/wordpress.png +0 -0
- data/public/images/service_icons/48/xanga.png +0 -0
- data/public/images/service_icons/48/yahoo.png +0 -0
- data/public/images/service_icons/48/yelp.png +0 -0
- data/public/images/service_icons/48/youtube.png +0 -0
- data/public/images/service_icons/48/zooomr.png +0 -0
- data/public/images/service_icons/48/zotero.png +0 -0
- data/public/images/service_icons/60/amazon.png +0 -0
- data/public/images/service_icons/60/ask.png +0 -0
- data/public/images/service_icons/60/bibsonomy.png +0 -0
- data/public/images/service_icons/60/bing.png +0 -0
- data/public/images/service_icons/60/blogger.png +0 -0
- data/public/images/service_icons/60/bloglines.png +0 -0
- data/public/images/service_icons/60/citeulike.png +0 -0
- data/public/images/service_icons/60/clipmarks.png +0 -0
- data/public/images/service_icons/60/connotea.png +0 -0
- data/public/images/service_icons/60/dailymotion.png +0 -0
- data/public/images/service_icons/60/delicious.png +0 -0
- data/public/images/service_icons/60/digg.png +0 -0
- data/public/images/service_icons/60/diigo.png +0 -0
- data/public/images/service_icons/60/facebook.png +0 -0
- data/public/images/service_icons/60/feed.png +0 -0
- data/public/images/service_icons/60/flickr.png +0 -0
- data/public/images/service_icons/60/fotolog.png +0 -0
- data/public/images/service_icons/60/friendfeed.png +0 -0
- data/public/images/service_icons/60/friendster.png +0 -0
- data/public/images/service_icons/60/furl.png +0 -0
- data/public/images/service_icons/60/goodreads.png +0 -0
- data/public/images/service_icons/60/google.png +0 -0
- data/public/images/service_icons/60/googleblog.png +0 -0
- data/public/images/service_icons/60/googlenews.png +0 -0
- data/public/images/service_icons/60/icerocket.png +0 -0
- data/public/images/service_icons/60/identica.png +0 -0
- data/public/images/service_icons/60/joost.png +0 -0
- data/public/images/service_icons/60/lastfm.png +0 -0
- data/public/images/service_icons/60/librarything.png +0 -0
- data/public/images/service_icons/60/linkedin.png +0 -0
- data/public/images/service_icons/60/livejournal.png +0 -0
- data/public/images/service_icons/60/magnolia.png +0 -0
- data/public/images/service_icons/60/mendeley.png +0 -0
- data/public/images/service_icons/60/metacafe.png +0 -0
- data/public/images/service_icons/60/mixx.png +0 -0
- data/public/images/service_icons/60/myspace.png +0 -0
- data/public/images/service_icons/60/netflix.png +0 -0
- data/public/images/service_icons/60/netvibes.png +0 -0
- data/public/images/service_icons/60/newsvine.png +0 -0
- data/public/images/service_icons/60/oai.png +0 -0
- data/public/images/service_icons/60/odeo.png +0 -0
- data/public/images/service_icons/60/opml.png +0 -0
- data/public/images/service_icons/60/pandora.png +0 -0
- data/public/images/service_icons/60/photobucket.png +0 -0
- data/public/images/service_icons/60/picasa.png +0 -0
- data/public/images/service_icons/60/polyvore.png +0 -0
- data/public/images/service_icons/60/pownce.png +0 -0
- data/public/images/service_icons/60/reddit.png +0 -0
- data/public/images/service_icons/60/simpy.png +0 -0
- data/public/images/service_icons/60/smugmug.png +0 -0
- data/public/images/service_icons/60/stumbleupon.png +0 -0
- data/public/images/service_icons/60/tag.png +0 -0
- data/public/images/service_icons/60/technorati.png +0 -0
- data/public/images/service_icons/60/tumblr.png +0 -0
- data/public/images/service_icons/60/twine.png +0 -0
- data/public/images/service_icons/60/twitter.png +0 -0
- data/public/images/service_icons/60/vimeo.png +0 -0
- data/public/images/service_icons/60/webshots.png +0 -0
- data/public/images/service_icons/60/wordpress.png +0 -0
- data/public/images/service_icons/60/xanga.png +0 -0
- data/public/images/service_icons/60/yahoo.png +0 -0
- data/public/images/service_icons/60/yelp.png +0 -0
- data/public/images/service_icons/60/youtube.png +0 -0
- data/public/images/service_icons/60/zooomr.png +0 -0
- data/public/images/service_icons/60/zotero.png +0 -0
- data/public/images/service_icons/facebook_friend_links.jpg +0 -0
- data/public/images/service_icons/facebook_my_links.jpg +0 -0
- data/public/javascripts/muck_services.js +94 -0
- data/public/stylesheets/frame.css +56 -0
- data/public/stylesheets/muck_services.css +90 -0
- data/rails/init.rb +18 -0
- data/test/rails_root/app/controllers/application_controller.rb +32 -0
- data/test/rails_root/app/controllers/default_controller.rb +7 -0
- data/test/rails_root/app/helpers/application_helper.rb +3 -0
- data/test/rails_root/app/models/activity.rb +24 -0
- data/test/rails_root/app/models/comment.rb +23 -0
- data/test/rails_root/app/models/share.rb +20 -0
- data/test/rails_root/app/models/user.rb +43 -0
- data/test/rails_root/app/models/user_session.rb +2 -0
- data/test/rails_root/config/boot.rb +109 -0
- data/test/rails_root/config/environment.rb +37 -0
- data/test/rails_root/config/environments/cucumber.rb +21 -0
- data/test/rails_root/config/environments/development.rb +36 -0
- data/test/rails_root/config/environments/production.rb +1 -0
- data/test/rails_root/config/environments/test.rb +34 -0
- data/test/rails_root/config/initializers/inflections.rb +10 -0
- data/test/rails_root/config/initializers/mime_types.rb +5 -0
- data/test/rails_root/config/initializers/requires.rb +13 -0
- data/test/rails_root/config/initializers/session_store.rb +8 -0
- data/test/rails_root/config/routes.rb +11 -0
- data/test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +16 -0
- data/test/rails_root/db/migrate/20090327231918_create_users.rb +40 -0
- data/test/rails_root/db/migrate/20090402033319_add_muck_activities.rb +36 -0
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
- data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
- data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
- data/test/rails_root/db/migrate/20090602191243_create_muck_raker.rb +322 -0
- data/test/rails_root/db/migrate/20090613173314_create_comments.rb +24 -0
- data/test/rails_root/db/migrate/20090619211125_create_tag_clouds.rb +19 -0
- data/test/rails_root/db/migrate/20090623181458_add_grain_size_to_entries.rb +16 -0
- data/test/rails_root/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
- data/test/rails_root/db/migrate/20090703175825_denormalize_entries_subjects.rb +39 -0
- data/test/rails_root/db/migrate/20090704220055_create_slugs.rb +18 -0
- data/test/rails_root/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +9 -0
- data/test/rails_root/db/migrate/20090717173900_add_contributor_to_feeds.rb +9 -0
- data/test/rails_root/db/migrate/20090717175825_normalize_entries_subjects.rb +41 -0
- data/test/rails_root/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
- data/test/rails_root/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
- data/test/rails_root/db/migrate/20090723050510_create_feed_parents.rb +17 -0
- data/test/rails_root/db/migrate/20090728165716_add_etag_to_feeds.rb +9 -0
- data/test/rails_root/db/migrate/20090730044139_add_comment_cache.rb +9 -0
- data/test/rails_root/db/migrate/20090730045848_add_comment_cache_to_entries.rb +9 -0
- data/test/rails_root/db/migrate/20090730154102_allow_null_user.rb +9 -0
- data/test/rails_root/db/migrate/20090803185323_create_shares.rb +16 -0
- data/test/rails_root/db/migrate/20090804184247_add_comment_count_to_shares.rb +9 -0
- data/test/rails_root/db/migrate/20090804211240_add_entry_id_to_shares.rb +9 -0
- data/test/rails_root/db/migrate/20090804231857_add_shares_uri_index.rb +9 -0
- data/test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb +9 -0
- data/test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb +13 -0
- data/test/rails_root/db/migrate/20090826220530_change_services_sequence_to_sort.rb +9 -0
- data/test/rails_root/db/migrate/20090826225652_create_identity_feeds.rb +14 -0
- data/test/rails_root/db/migrate/20090827005105_add_identity_fields_to_services.rb +13 -0
- data/test/rails_root/db/migrate/20090827015308_create_service_categories.rb +12 -0
- data/test/rails_root/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +11 -0
- data/test/rails_root/db/migrate/20090915041650_aggregations_to_polymorphic.rb +15 -0
- data/test/rails_root/db/migrate/20090922174200_update_oai_endpoints.rb +13 -0
- data/test/rails_root/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +11 -0
- data/test/rails_root/db/migrate/20090923150807_rename_name_in_aggregation.rb +9 -0
- data/test/rails_root/db/migrate/20090924200750_add_uri_data_template_to_services.rb +9 -0
- data/test/rails_root/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +9 -0
- data/test/rails_root/db/migrate/20091022150615_add_uri_key_to_services.rb +9 -0
- data/test/rails_root/db/schema.rb +474 -0
- data/test/rails_root/features/step_definitions/common_steps.rb +93 -0
- data/test/rails_root/features/step_definitions/visit_steps.rb +6 -0
- data/test/rails_root/features/step_definitions/webrat_steps.rb +128 -0
- data/test/rails_root/features/support/env.rb +14 -0
- data/test/rails_root/features/support/paths.rb +36 -0
- data/test/rails_root/public/dispatch.rb +10 -0
- data/test/rails_root/script/create_project.rb +52 -0
- data/test/rails_root/test/factories.rb +151 -0
- data/test/rails_root/test/functional/admin/feeds_controller_test.rb +37 -0
- data/test/rails_root/test/functional/admin/oai_endpoints_controller_test.rb +30 -0
- data/test/rails_root/test/functional/aggregation_feeds_controller_test.rb +67 -0
- data/test/rails_root/test/functional/aggregations_controller_test.rb +89 -0
- data/test/rails_root/test/functional/feed_previews_controller_test.rb +32 -0
- data/test/rails_root/test/functional/feeds_controller_test.rb +77 -0
- data/test/rails_root/test/functional/identity_feeds_controller_test.rb +110 -0
- data/test/rails_root/test/functional/oai_endpoints_controller_test.rb +42 -0
- data/test/rails_root/test/functional/topics_controller_test.rb +46 -0
- data/test/rails_root/test/functional/visits_controller_test.rb +21 -0
- data/test/rails_root/test/shoulda_macros/controller.rb +49 -0
- data/test/rails_root/test/shoulda_macros/forms.rb +32 -0
- data/test/rails_root/test/shoulda_macros/models.rb +50 -0
- data/test/rails_root/test/shoulda_macros/pagination.rb +53 -0
- data/test/rails_root/test/shoulda_macros/plugins.rb +34 -0
- data/test/rails_root/test/test_helper.rb +85 -0
- data/test/rails_root/test/unit/aggregation_feed_test.rb +25 -0
- data/test/rails_root/test/unit/aggregation_test.rb +120 -0
- data/test/rails_root/test/unit/comment_test.rb +38 -0
- data/test/rails_root/test/unit/entry_test.rb +65 -0
- data/test/rails_root/test/unit/feed_parent_test.rb +22 -0
- data/test/rails_root/test/unit/feed_test.rb +177 -0
- data/test/rails_root/test/unit/identity_feed_test.rb +18 -0
- data/test/rails_root/test/unit/oai_endpoint_test.rb +40 -0
- data/test/rails_root/test/unit/service_category_test.rb +19 -0
- data/test/rails_root/test/unit/service_test.rb +331 -0
- data/test/rails_root/test/unit/services_mailer_test.rb +35 -0
- data/test/rails_root/test/unit/share_test.rb +30 -0
- data/test/rails_root/test/unit/tag_cloud_test.rb +23 -0
- data/test/rails_root/test/unit/user_test.rb +43 -0
- data/test/rails_root/vendor/plugins/jrails/init.rb +1 -0
- data/test/rails_root/vendor/plugins/jrails/install.rb +9 -0
- data/test/rails_root/vendor/plugins/jrails/lib/jrails.rb +421 -0
- data/test/rails_root/vendor/plugins/jrails/rails/init.rb +15 -0
- data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +62 -0
- data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +132 -0
- metadata +991 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
module MuckServicesServiceHelper
|
2
|
+
|
3
|
+
# Render a summary of all services for the given parent. The parent should 'acts_as_muck_feed_owner'
|
4
|
+
def services_summary(parent)
|
5
|
+
identity_feeds = parent.identity_feeds.find(:all, :include => [{:feed => :service}])
|
6
|
+
render :partial => 'services/summary', :locals => { :identity_feeds => identity_feeds }
|
7
|
+
end
|
8
|
+
|
9
|
+
# Render a view with all services in categories.
|
10
|
+
# service_categories: Results from a query to service_categories. For performance try something like this:
|
11
|
+
# ServiceCategory.sorted.find(:all, :include => [:identity_services])
|
12
|
+
# title: Optional title. Default is 'Available Services' - from I18n.t('muck.services.available_services')
|
13
|
+
# css: Optional css to be added to the div that surrounds the categories
|
14
|
+
def available_service_categories(service_categories, title = nil, css = '')
|
15
|
+
render :partial => 'identity_feeds/available_service_categories', :locals => { :service_categories => service_categories, :css => css, :title => title }
|
16
|
+
end
|
17
|
+
|
18
|
+
# Render a view with the user's registered services.
|
19
|
+
# identity_feeds: Results from a query to service_categories. For performance try something like this:
|
20
|
+
# @user.identity_feeds.find(:all, :include => [{:feed => :service}])
|
21
|
+
# title: Optional title. Default is 'My Services' - from I18n.t('muck.services.my_services')
|
22
|
+
# css: Optional css to be added to the div that surrounds the categories
|
23
|
+
def services_for_user(identity_feeds, title = nil, css = '')
|
24
|
+
render :partial => 'identity_feeds/services_for_user', :locals => { :identity_feeds => identity_feeds, :css => css, :title => title, :edit => false }
|
25
|
+
end
|
26
|
+
|
27
|
+
# Render an edit view with the user's registered services.
|
28
|
+
# identity_feeds: Results from a query to service_categories. For performance try something like this:
|
29
|
+
# @user.identity_feeds.find(:all, :include => [{:feed => :service}])
|
30
|
+
# title: Optional title. Default is 'My Services' - from I18n.t('muck.services.my_services')
|
31
|
+
# css: Optional css to be added to the div that surrounds the categories
|
32
|
+
def services_for_user_edit(identity_feeds, title = nil, css = '')
|
33
|
+
render :partial => 'identity_feeds/services_for_user', :locals => { :identity_feeds => identity_feeds, :css => css, :title => title, :edit => true }
|
34
|
+
end
|
35
|
+
|
36
|
+
# Renders an icon for the given service
|
37
|
+
# Name is the name of the image file associated with the service
|
38
|
+
# Size can be one of 16, 24, 48 or 60.
|
39
|
+
def service_icon(name, size = 24)
|
40
|
+
%Q{<img src="/images/service_icons/#{size}/#{name}" />}
|
41
|
+
end
|
42
|
+
|
43
|
+
def service_image(name, size = 24)
|
44
|
+
%Q{/images/service_icons/#{size}/#{name}}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Renders name and icon for the service
|
48
|
+
def service_title(service)
|
49
|
+
%Q{<div class="identity-service-title" #{service_icon_background(service)}>#{service_prompt(service)}</div>}
|
50
|
+
end
|
51
|
+
|
52
|
+
# By default renders Service username e.g. Flickr username
|
53
|
+
# If the service has a 'prompt' set it will look for a value in the localization
|
54
|
+
# files. For example, setting service.prompt to 'blog_url' will cause this method
|
55
|
+
# to look for a translation at muck.services.blog_url and will pass the name of the service
|
56
|
+
# using 'service' so your translation might look like:
|
57
|
+
# muck.services.blog_url: "Blog Url" or
|
58
|
+
# muck.services.facebook_prompt: "{{service}} Feeds"
|
59
|
+
def service_prompt(service)
|
60
|
+
if @service.prompt.blank?
|
61
|
+
I18n.t('muck.services.service_username', :service => @service.name)
|
62
|
+
else
|
63
|
+
I18n.t("muck.services.#{@service.prompt}", :service => @service.name)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Renders a link for a new user service with class 'lightbox' or optional css set on the link.
|
68
|
+
def service_lightbox(parent, service, link_css = 'lightbox', wrapper = 'li')
|
69
|
+
path = new_polymorphic_url([parent, :identity_feed], :service_id => service.to_param)
|
70
|
+
service_link(path, service, link_css, wrapper, nil, nil, "#{service.name.parameterize}-link")
|
71
|
+
end
|
72
|
+
|
73
|
+
# Renders a link for editing a user feed with class 'lightbox' or optional css set on the link.
|
74
|
+
def service_lightbox_edit(parent, identity_feed, link_css = 'lightbox', wrapper = nil)
|
75
|
+
path = edit_polymorphic_url([parent, identity_feed])
|
76
|
+
link_text = identity_feed.feed.title unless identity_feed.feed.title.blank?
|
77
|
+
service_link(path, identity_feed.feed.service, link_css, wrapper, link_text)
|
78
|
+
end
|
79
|
+
|
80
|
+
def service_external_link(identity_feed, link_css = nil, wrapper = nil)
|
81
|
+
path = identity_feed.feed.display_uri || identity_feed.feed.uri
|
82
|
+
link_text = identity_feed.feed.title unless identity_feed.feed.title.blank?
|
83
|
+
service_link(path, identity_feed.feed.service, link_css, wrapper, link_text, 'blank')
|
84
|
+
end
|
85
|
+
|
86
|
+
# Renders a delete button for an identity_feed
|
87
|
+
def service_delete(identity_feed, button_type = :button, button_text = t("muck.general.delete"))
|
88
|
+
render :partial => 'shared/delete', :locals => { :delete_object => identity_feed,
|
89
|
+
:button_type => button_type,
|
90
|
+
:button_text => button_text,
|
91
|
+
:form_class => 'identity-feed-delete',
|
92
|
+
:delete_path => identity_feed_path(identity_feed, :format => 'js') }
|
93
|
+
end
|
94
|
+
|
95
|
+
# Renders a service link optionally wrapping it in the specified element
|
96
|
+
def service_link(path, service, link_css, wrapper, link_text = nil, target = nil, id = nil)
|
97
|
+
link = %Q{<a #{'id=' + id if id} href="#{path}" #{service_icon_background(service)} #{'target=' + target if target} class="service-link #{link_css}">#{link_text || service.name}</a>}
|
98
|
+
if wrapper
|
99
|
+
content_tag wrapper, link, :class => 'identity-service'
|
100
|
+
else
|
101
|
+
link
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def service_icon_background(service)
|
106
|
+
%Q{style="background: transparent url('#{service_image(service.icon, 24)}') no-repeat scroll left top;"}
|
107
|
+
end
|
108
|
+
|
109
|
+
def url_by_identity_feed(owner, identity_feed, service)
|
110
|
+
if identity_feed
|
111
|
+
polymorphic_url([owner, identity_feed], :service_id => service.to_param)
|
112
|
+
else
|
113
|
+
polymorphic_url([owner, :identity_feeds], :service_id => service.to_param)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: aggregations
|
4
|
+
#
|
5
|
+
# id :integer(4) not null, primary key
|
6
|
+
# terms :string(255)
|
7
|
+
# title :string(255)
|
8
|
+
# description :text
|
9
|
+
# top_tags :text
|
10
|
+
# created_at :datetime
|
11
|
+
# updated_at :datetime
|
12
|
+
# ownable_id :integer(4)
|
13
|
+
# ownable_type :string(255)
|
14
|
+
#
|
15
|
+
|
16
|
+
class Aggregation < ActiveRecord::Base
|
17
|
+
unloadable
|
18
|
+
|
19
|
+
has_friendly_id :terms, :use_slug => true
|
20
|
+
|
21
|
+
belongs_to :ownable, :polymorphic => true
|
22
|
+
has_many :aggregation_feeds
|
23
|
+
has_many :feeds, :through => :aggregation_feeds
|
24
|
+
|
25
|
+
named_scope :by_title, :order => "title ASC"
|
26
|
+
named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
|
27
|
+
named_scope :newest, :order => "created_at DESC"
|
28
|
+
|
29
|
+
# Builds and then adds feeds for a given terms
|
30
|
+
# user: User to be associated with each feed. Default is nil which makes each feed global.
|
31
|
+
# service_ids: An array of service ids. Nil will generate a feed for every available service.
|
32
|
+
# refresh_services: By default all tag services are cached. Setting this value to true
|
33
|
+
# will result in the values being repopulated from the database
|
34
|
+
def add_feeds(user = nil, service_ids = nil, refresh_services = false)
|
35
|
+
safe_add_feeds(Service.create_tag_feeds(self.terms, user, service_ids, refresh_services))
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_feeds_by_uri(user = nil, uris = nil)
|
39
|
+
safe_add_feeds(Feed.create_tag_feeds(user, uris))
|
40
|
+
end
|
41
|
+
|
42
|
+
# Only add feeds that aren't already part of the aggregation
|
43
|
+
def safe_add_feeds(new_feeds)
|
44
|
+
new_feeds.each do |feed|
|
45
|
+
begin
|
46
|
+
self.feeds << feed
|
47
|
+
rescue ActiveRecord::RecordInvalid => ex
|
48
|
+
# Throw away exception. Feed already exists so we don't need to do anything.
|
49
|
+
end
|
50
|
+
end
|
51
|
+
new_feeds
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get only photo feeds
|
55
|
+
def photo_feeds(refresh_services = false)
|
56
|
+
all_feeds.find_all{ |feed| feed.service.photo?(refresh_services) rescue nil }
|
57
|
+
end
|
58
|
+
|
59
|
+
# Get only video feeds
|
60
|
+
def video_feeds(refresh_services = false)
|
61
|
+
all_feeds.find_all{ |feed| feed.service.video?(refresh_services) rescue nil }
|
62
|
+
end
|
63
|
+
|
64
|
+
# Get only bookmark feeds
|
65
|
+
def bookmark_feeds(refresh_services = false)
|
66
|
+
all_feeds.find_all{ |feed| feed.service.bookmark?(refresh_services) rescue nil }
|
67
|
+
end
|
68
|
+
|
69
|
+
# Get only music feeds
|
70
|
+
def music_feeds(refresh_services = false)
|
71
|
+
all_feeds.find_all{ |feed| feed.service.music?(refresh_services) rescue nil}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Get only general feeds (exclude all specific feeds such as photos, videos, etc)
|
75
|
+
def general_feeds(refresh_services = false)
|
76
|
+
all_feeds.find_all{ |feed| feed.service.general?(refresh_services) rescue nil }
|
77
|
+
end
|
78
|
+
|
79
|
+
def all_feeds
|
80
|
+
@all_feeds ||= self.feeds.find(:all, :include => :service)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Determines whether or not he given user can edit the aggregation
|
84
|
+
def can_edit?(user)
|
85
|
+
if ownable == user || user.admin?
|
86
|
+
true
|
87
|
+
else
|
88
|
+
false
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: aggregation_feeds
|
4
|
+
#
|
5
|
+
# id :integer(4) not null, primary key
|
6
|
+
# aggregation_id :integer(4)
|
7
|
+
# feed_id :integer(4)
|
8
|
+
#
|
9
|
+
|
10
|
+
class AggregationFeed < ActiveRecord::Base
|
11
|
+
belongs_to :aggregation, :counter_cache => 'feed_count', :touch => true
|
12
|
+
belongs_to :feed
|
13
|
+
validates_uniqueness_of :feed_id, :scope => :aggregation_id
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: attentions
|
4
|
+
#
|
5
|
+
# id :integer(4) not null, primary key
|
6
|
+
# attentionable_id :integer(4)
|
7
|
+
# attentionable_type :string(255)
|
8
|
+
# entry_id :integer(4)
|
9
|
+
# action_type :string(255)
|
10
|
+
# weight :float
|
11
|
+
#
|
12
|
+
|
13
|
+
class Attention < ActiveRecord::Base
|
14
|
+
end
|
data/app/models/click.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: clicks
|
4
|
+
#
|
5
|
+
# id :integer(4) not null, primary key
|
6
|
+
# recommendation_id :integer(4)
|
7
|
+
# when :datetime not null
|
8
|
+
# referrer :string(2083)
|
9
|
+
# requester :string(255)
|
10
|
+
# user_agent :string(2083)
|
11
|
+
#
|
12
|
+
|
13
|
+
class Click < ActiveRecord::Base
|
14
|
+
end
|
data/app/models/entry.rb
ADDED
@@ -0,0 +1,341 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: entries
|
4
|
+
#
|
5
|
+
# id :integer(4) not null, primary key
|
6
|
+
# feed_id :integer(4) not null
|
7
|
+
# permalink :string(2083) default(""), not null
|
8
|
+
# author :string(2083)
|
9
|
+
# title :text default(""), not null
|
10
|
+
# description :text
|
11
|
+
# content :text
|
12
|
+
# unique_content :boolean(1)
|
13
|
+
# published_at :datetime not null
|
14
|
+
# entry_updated_at :datetime
|
15
|
+
# harvested_at :datetime
|
16
|
+
# oai_identifier :string(2083)
|
17
|
+
# language_id :integer(4)
|
18
|
+
# direct_link :string(2083)
|
19
|
+
# indexed_at :datetime default(Fri Jan 01 01:01:01 UTC 1971), not null
|
20
|
+
# relevance_calculated_at :datetime default(Fri Jan 01 01:01:01 UTC 1971), not null
|
21
|
+
# popular :text
|
22
|
+
# relevant :text
|
23
|
+
# other :text
|
24
|
+
# grain_size :string(255) default("unknown")
|
25
|
+
#
|
26
|
+
# Indexes
|
27
|
+
#
|
28
|
+
# index_entries_on_direct_link (direct_link)
|
29
|
+
# index_entries_on_feed_id (feed_id)
|
30
|
+
# index_entries_on_indexed_at (indexed_at)
|
31
|
+
# index_entries_on_language_id (language_id)
|
32
|
+
# index_entries_on_oai_identifier (oai_identifier)
|
33
|
+
# index_entries_on_permalink (permalink)
|
34
|
+
# index_entries_on_published_at (published_at)
|
35
|
+
# index_entries_on_relevance_calculated_at (relevance_calculated_at)
|
36
|
+
# index_entries_on_grain_size (grain_size)
|
37
|
+
#
|
38
|
+
|
39
|
+
class Entry < ActiveRecord::Base
|
40
|
+
|
41
|
+
unloadable
|
42
|
+
|
43
|
+
belongs_to :feed
|
44
|
+
belongs_to :language
|
45
|
+
has_many :activities, :as => :attachable, :dependent => :destroy
|
46
|
+
has_many :attentions, :dependent => :destroy
|
47
|
+
acts_as_commentable
|
48
|
+
acts_as_taggable
|
49
|
+
|
50
|
+
@@default_time_on_page = 60.0
|
51
|
+
|
52
|
+
acts_as_solr({:if => false, :fields => [{:feed_id => :integer}, {:grain_size => :string}]}, {:type_field => :type_s})
|
53
|
+
|
54
|
+
def resource_uri
|
55
|
+
self.direct_link.nil? ? self.permalink : self.direct_link
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.top_tags(tags = nil)
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.search(search_terms, grain_size = nil, language = "en", limit = 10, offset = 0, operator = :or)
|
63
|
+
raise MuckServices::Exceptions::LanguageNotSupported, I18n.t('muck.services.language_not_supported') unless Recommender::Languages.supported_languages.include?(language)
|
64
|
+
query = (!grain_size.nil? && grain_size != 'all') ? (search_terms + ") AND (grain_size:#{grain_size}") : search_terms
|
65
|
+
return find_by_solr(query, :limit => limit, :offset => offset, :scores => true, :select => "entries.id, entries.title, entries.permalink, entries.direct_link, entries.published_at, entries.description, entries.feed_id, feeds.short_title AS collection", :joins => "INNER JOIN feeds ON feeds.id = entries.feed_id", :core => language, :operator => operator)
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.recommender_entry(uri)
|
69
|
+
uri = normalized_uri(uri)
|
70
|
+
Entry.find(:first, :conditions => ['permalink = ? OR direct_link = ?', uri, uri], :order => 'direct_link IS NULL DESC') || Entry.new(:permalink => uri)
|
71
|
+
end
|
72
|
+
|
73
|
+
def recommendations(limit = 20, order = "relevance", details = false, omit_feeds = nil)
|
74
|
+
sql = "SELECT recommendations.id, dest_entry_id, entries.permalink, entries.title, entries.description, entries.direct_link, feeds.short_title AS collection "
|
75
|
+
sql << ", relevance_calculated_at, relevance, clicks, avg_time_at_dest AS avg_time_on_target, author, published_at " if details == true
|
76
|
+
sql << "FROM recommendations "
|
77
|
+
sql << "INNER JOIN entries ON recommendations.dest_entry_id = entries.id "
|
78
|
+
sql << "INNER JOIN feeds ON entries.feed_id = feeds.id "
|
79
|
+
sql << "WHERE recommendations.entry_id = ? "
|
80
|
+
sql << ("AND entries.feed_id NOT IN (" + omit_feeds.gsub(/[^0-9,]/,'') + ") ") if omit_feeds != nil
|
81
|
+
sql << "ORDER BY " + order + " DESC "
|
82
|
+
sql << "LIMIT " + limit.to_s
|
83
|
+
Entry.find_by_sql([sql,self.id])
|
84
|
+
end
|
85
|
+
|
86
|
+
def recommendation_entries(limit = 20, order = "relevance", details = false, omit_feeds = nil)
|
87
|
+
sql = "SELECT recommendations.dest_entry_id AS id, entries.permalink, entries.title, entries.description, entries.direct_link, feeds.short_title AS collection "
|
88
|
+
sql << ", relevance_calculated_at, relevance, clicks, avg_time_at_dest AS avg_time_on_target, author, published_at " if details == true
|
89
|
+
sql << "FROM recommendations "
|
90
|
+
sql << "INNER JOIN entries ON recommendations.dest_entry_id = entries.id "
|
91
|
+
sql << "INNER JOIN feeds ON entries.feed_id = feeds.id "
|
92
|
+
sql << "WHERE recommendations.entry_id = ? "
|
93
|
+
sql << ("AND entries.feed_id NOT IN (" + omit_feeds.gsub(/[^0-9,]/,'') + ") ") if omit_feeds != nil
|
94
|
+
sql << "ORDER BY " + order + " DESC "
|
95
|
+
sql << "LIMIT " + limit.to_s
|
96
|
+
Entry.find_by_sql([sql,self.id])
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.track_time_on_page(session, uri)
|
100
|
+
recommendation_id = session[:last_clicked_recommendation]
|
101
|
+
if !recommendation_id.nil?
|
102
|
+
time_on_page = (Time.now - session[:last_clicked_recommendation_time].to_f).to_i
|
103
|
+
|
104
|
+
# if they spend longer than two minutes on a page, we don't infer anything
|
105
|
+
if time_on_page > 5 and time_on_page < 120
|
106
|
+
if normalized_uri(uri) != session[:last_clicked_recommendation_uri]
|
107
|
+
recommendation = Recommendation.find(recommendation_id)
|
108
|
+
entry = Entry.find(recommendation.entry_id)
|
109
|
+
new_avg = (recommendation.avg_time_at_dest*recommendation.clicks - @@default_time_on_page + time_on_page)/recommendation.clicks
|
110
|
+
recommendation.avg_time_at_dest = new_avg
|
111
|
+
recommendation.save!
|
112
|
+
entry.rank_recommendations
|
113
|
+
session[:last_clicked_recommendation] = nil
|
114
|
+
end
|
115
|
+
else
|
116
|
+
session[:last_clicked_recommendation] = nil if time_on_page > 5
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.avg_time(clicks, old_avg, time_on_page)
|
122
|
+
return (old_avg*(clicks-1) + time_on_page)/clicks
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.track_click(session, recommendation_id, referrer, redirect_type = "direct_link", requester = "unknown", user_agent = "unknown")
|
126
|
+
# look up the recommendation
|
127
|
+
recommendation = Recommendation.find(recommendation_id)
|
128
|
+
return "" if !recommendation
|
129
|
+
|
130
|
+
# get the entries being linked from and to
|
131
|
+
entry = Entry.find(recommendation.entry_id)
|
132
|
+
target = Entry.find(recommendation.dest_entry_id)
|
133
|
+
|
134
|
+
# get the list of recommendations that have been clicked during this session
|
135
|
+
clicks = session[:rids] || Array.new
|
136
|
+
|
137
|
+
# redirect to our frame page
|
138
|
+
redirect = "/visits/#{recommendation.dest_entry_id}"
|
139
|
+
|
140
|
+
# track the time on the last page
|
141
|
+
track_time_on_page(session, redirect)
|
142
|
+
|
143
|
+
# if this is first time the user clicked on this recommendation during this session
|
144
|
+
if !clicks.include?(recommendation_id)
|
145
|
+
|
146
|
+
# add this recommendation to the end of the list
|
147
|
+
clicks << recommendation_id
|
148
|
+
session[:rids] = clicks
|
149
|
+
|
150
|
+
# update the click time
|
151
|
+
recommendation.avg_time_at_dest = ((recommendation.avg_time_at_dest*recommendation.clicks) + @@default_time_on_page)/(recommendation.clicks + 1)
|
152
|
+
recommendation.clicks += 1
|
153
|
+
recommendation.save!
|
154
|
+
|
155
|
+
# store info about this click in the session
|
156
|
+
now = Time.now
|
157
|
+
session[:last_clicked_recommendation] = recommendation_id
|
158
|
+
session[:last_clicked_recommendation_time] = now
|
159
|
+
session[:last_clicked_recommendation_uri] = redirect
|
160
|
+
|
161
|
+
# update the recommendation cache for the entry
|
162
|
+
entry.rank_recommendations if entry
|
163
|
+
|
164
|
+
# track the click in the db
|
165
|
+
Click.create(:recommendation_id => recommendation_id, :when => now, :referrer => referrer, :requester => requester, :user_agent => user_agent)
|
166
|
+
end
|
167
|
+
|
168
|
+
return redirect
|
169
|
+
end
|
170
|
+
|
171
|
+
def relevant_recommendations(limit = 5, order = "relevance", details = false, omit_feeds = nil)
|
172
|
+
return self.recommendations(limit, order, details, omit_feeds)
|
173
|
+
end
|
174
|
+
|
175
|
+
def self.truncate_words(text, length = 30, end_string = ' ...')
|
176
|
+
words = text.split()
|
177
|
+
words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
|
178
|
+
end
|
179
|
+
|
180
|
+
def ranked_recommendations(limit = 5, order = "mixed", details = false, omit_feeds = nil)
|
181
|
+
# if self.id.nil?
|
182
|
+
# return Entry.real_time_recommendations(self.permalink, details, :core => 'en', :limit => limit)
|
183
|
+
# else
|
184
|
+
return relevant_recommendations(limit, "clicks DESC, relevance", details, omit_feeds) if order == "clicks"
|
185
|
+
return relevant_recommendations(limit, "relevance", details, omit_feeds) if (order == "relevance" || details == true)
|
186
|
+
return relevant_recommendations_filtered(limit, details, omit_feeds) if omit_feeds != nil
|
187
|
+
# end
|
188
|
+
|
189
|
+
recs = []
|
190
|
+
if self.popular != nil && !self.popular.empty?
|
191
|
+
recs.concat(ActiveSupport::JSON.decode(self.popular).first(limit))
|
192
|
+
end
|
193
|
+
if recs.length < limit && self.relevant != nil && !self.relevant.empty?
|
194
|
+
relevant_recs = randomize(ActiveSupport::JSON.decode(self.relevant))
|
195
|
+
recs.concat(relevant_recs.first(limit - recs.length))
|
196
|
+
end
|
197
|
+
if recs.length < limit && self.relevant != nil && !self.other.empty?
|
198
|
+
other_recs = randomize(ActiveSupport::JSON.decode(self.other))
|
199
|
+
recs.concat(other_recs.first(limit - recs.length))
|
200
|
+
end
|
201
|
+
return recs
|
202
|
+
end
|
203
|
+
|
204
|
+
def relevant_recommendations_filtered(limit, details, omit_feeds)
|
205
|
+
# get recommendations for the entry from the recommendations table
|
206
|
+
recs = self.recommendations(limit, "mixed", details, omit_feeds)
|
207
|
+
|
208
|
+
# for storing the various lists
|
209
|
+
popular_recs = []
|
210
|
+
relevant_recs = []
|
211
|
+
other_recs = []
|
212
|
+
|
213
|
+
# see where to cut draw the lines for popular and relevant
|
214
|
+
click_threshold = calc_click_threshold(recs)
|
215
|
+
relevance_threshold = calc_relevance_threshold(recs)
|
216
|
+
|
217
|
+
# store the recommendations
|
218
|
+
recs.each do |r|
|
219
|
+
if (r["clicks"].to_i > click_threshold)
|
220
|
+
popular_recs << r
|
221
|
+
elsif (r["relevance"].to_f > relevance_threshold)
|
222
|
+
relevant_recs << r
|
223
|
+
else
|
224
|
+
other_recs << r
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# order popular items strictly by clicks
|
229
|
+
popular_recs.sort{|r1,r2| r2["avg_time_on_target"].to_i <=> r1["avg_time_on_target"].to_i}
|
230
|
+
|
231
|
+
return popular_recs[0..limit] if popular_recs.size > limit
|
232
|
+
return (popular_recs + relevant_recs)[0..limit] if (popular_recs.size + relevant_recs.size) > limit
|
233
|
+
return (popular_recs + relevant_recs + other_recs)[0..limit]
|
234
|
+
end
|
235
|
+
|
236
|
+
def json_recommendations(limit = 5, order = "mixed", details = false, omit_feeds = nil)
|
237
|
+
ActiveSupport::JSON.encode(ranked_recommendations(limit, order, details, omit_feeds))
|
238
|
+
end
|
239
|
+
|
240
|
+
def rank_recommendations
|
241
|
+
return
|
242
|
+
# get recommendations for the entry from the recommendations table
|
243
|
+
recs = self.recommendations
|
244
|
+
|
245
|
+
# for storing the various lists
|
246
|
+
popular_recs = []
|
247
|
+
relevant_recs = []
|
248
|
+
other_recs = []
|
249
|
+
|
250
|
+
# see where to cut draw the lines for popular and relevant
|
251
|
+
click_threshold = calc_click_threshold(recs)
|
252
|
+
relevance_threshold = calc_relevance_threshold(recs)
|
253
|
+
|
254
|
+
# store the recommendations
|
255
|
+
recs.each do |r|
|
256
|
+
if (r["clicks"].to_i > click_threshold)
|
257
|
+
popular_recs << r
|
258
|
+
elsif (r["relevance"].to_f > relevance_threshold)
|
259
|
+
relevant_recs << r
|
260
|
+
else
|
261
|
+
other_recs << r
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# order popular items strictly by clicks
|
266
|
+
popular_recs.sort{|r1,r2| r2["avg_time_on_target"].to_i <=> r1["avg_time_on_target"].to_i}
|
267
|
+
|
268
|
+
# cache the JSON for the lists in the entry record
|
269
|
+
self.popular = ActiveSupport::JSON.encode(popular_recs)
|
270
|
+
self.relevant = ActiveSupport::JSON.encode(relevant_recs)
|
271
|
+
self.other = ActiveSupport::JSON.encode(other_recs)
|
272
|
+
self.save!
|
273
|
+
end
|
274
|
+
|
275
|
+
def randomize(recs)
|
276
|
+
i = recs.length
|
277
|
+
return recs if (i == 0)
|
278
|
+
while (i > 0)
|
279
|
+
i = i - 1
|
280
|
+
j = (rand*(i+1)).floor
|
281
|
+
ti = recs[i]
|
282
|
+
tj =recs[j]
|
283
|
+
recs[i] = tj
|
284
|
+
recs[j] = ti
|
285
|
+
end
|
286
|
+
return recs
|
287
|
+
end
|
288
|
+
|
289
|
+
def calc_relevance_threshold(recs)
|
290
|
+
sum = 0
|
291
|
+
recs.each do |r|
|
292
|
+
sum += r["relevance"].to_f
|
293
|
+
end
|
294
|
+
average = sum/recs.length
|
295
|
+
sum = 0
|
296
|
+
recs.each do |r|
|
297
|
+
sum += (r["relevance"].to_f-average)**2
|
298
|
+
end
|
299
|
+
standard_deviation = Math.sqrt(sum/recs.length);
|
300
|
+
return average + standard_deviation
|
301
|
+
end
|
302
|
+
|
303
|
+
def calc_click_threshold(recs)
|
304
|
+
sum = 0
|
305
|
+
recs.each do |r|
|
306
|
+
sum += r["clicks"].to_f
|
307
|
+
end
|
308
|
+
average = sum/recs.length
|
309
|
+
sum = 0
|
310
|
+
recs.each do |r|
|
311
|
+
sum += (r["clicks"].to_f-average)**2
|
312
|
+
end
|
313
|
+
standard_deviation = Math.sqrt(sum/recs.length);
|
314
|
+
threshold = average + standard_deviation
|
315
|
+
return threshold > 5 ? threshold : 5
|
316
|
+
end
|
317
|
+
|
318
|
+
protected
|
319
|
+
|
320
|
+
# def self.redirect_uri(target, referrer, redirect_type)
|
321
|
+
# if !target.direct_link.nil? and redirect_type != "metadata"
|
322
|
+
# return target.direct_link if redirect_type == "direct_link"
|
323
|
+
# if !referrer.nil?
|
324
|
+
# domain = "http://" + URI.parse(referrer).host
|
325
|
+
# return target.direct_link if target.permalink[0..domain.length-1] != domain
|
326
|
+
# end
|
327
|
+
# end
|
328
|
+
# return target.permalink
|
329
|
+
# end
|
330
|
+
|
331
|
+
def self.normalized_uri(uri)
|
332
|
+
uri.sub(/index.?\.(html|aspx|shtm|htm|asp|php|cfm|jsp|shtml|jhtml)$/, '')
|
333
|
+
end
|
334
|
+
|
335
|
+
def self.real_time_recommendations(uri, details = false, options = {})
|
336
|
+
fields = "entries.id, entries.title, entries.permalink, entries.direct_link, feeds.short_title AS collection"
|
337
|
+
fields << ", entries.published_at, entries.description, entries.author" if details == true
|
338
|
+
more_like_this(uri, options.merge(:select => fields, :joins => "INNER JOIN feeds ON feeds.id = entries.feed_id"))
|
339
|
+
end
|
340
|
+
|
341
|
+
end
|