How to get most popular post with Ruby on Rails? - ruby-on-rails

Is there a gem that implements "most popular" functionality for ActiveRecord / Ruby on Rails.
I have a model Article, and I would like to retrieve the most popular / most read articles, using my Google Analytics data.
I have written this in PHP from scratch and was wondering if there is a plugin/gem for Rails available.
Thank you,
Anton

You can search rubygems here
http://rubygems.org/search?utf8=%E2%9C%93&query=google+analytics
There are a lot of gems that can integrate with google analytics.

I found this gem to do most of what I need.
https://github.com/vigetlabs/garb

Related

Buying domain using API

I've been googling for more than 2 weeks to find any Rails code working with OpenSRS API, but I couldn't find any good solution at all.
Could anyone give me some example or references of using OpenSRS API with Rails 3?
After some quick browsing on the OpenSRS site, I found this gem. start here, definitely:
https://github.com/voxxit/opensrs
If you want to write it all yourself, the ruby toolkit is on this page: http://www.opensrs.com/site/resources/documentation/api#api
But really, the opensrs gem looks like it's all you'll need.

Adding search to our Rails 3 App

What would be the best way to implement a searchability feature in the site header of our Rails 3 App?
We have users that can follow each other, and we are receiving feedback in large volumes that a search bar would be a highly advantageous addition to our app.
Thanks guys, in advance.
Hi scud bomb,
There are couple of good gems in the market for implementing searchability feature.
the most commonly used gems
sunspot + solr (https://github.com/outoftime/sunspot)
acts_as_indexed (https://github.com/dougal/acts_as_indexed)
thinking-sphinx (https://github.com/freelancing-god/thinking-sphinx)
But i would say Sunspot is the best option.Basically sunspot is a ruby library that interacts with the solr search engine for powerful searching.
there is good blog on this topic have a look.
http://www.idyllic-software.com/blog/fulltext-search-with-sunspot/
My favorite is sunspot: http://sunspot.github.com/. The documentation is very clear. There's even a RailsCast for it to help you out: http://railscasts.com/episodes/278-search-with-sunspot.

Twitter bot with Rails

I am trying to create a Twitter bot with Ruby on Rails but I just dont find any useful information on this manner...
Is it posible?
I tried with the GEM twibot but it is deprecated it is not longer useful.
Does Rails have a method for trigger events when (for example) a twit is posted?
Anyone have worked with something like this?
Any tutorial?
Any information at all that is in current use, I mean that does work today with the Twitter API (Many of the stuff I googled does not work now)?
Thank you very much.
Twitter itself is running on Rails, and it has a REST API. You could easily write your own solution with ActiveResource
You can get started with the ActiveResource videos on Railscasts
rails per se does not have any support for twitter. it's just an mvc-web-framework. but there are a lot of ruby gems for twitter. my favorite is this https://github.com/jnunemaker/twitter but you can find a lot more here https://www.ruby-toolbox.com/categories/api_clients.html

ruby gem or rails tips on how to use xmlrpc server/ weblog api

i am trying to get my rails app interfacing with blogging clients. first of all i am not sure which one to choose from (metaweblog, wordpress, movabletype, atompub). second, is there any tutorial on how to implement such a XMLRPC (or similar) server with rails 3?
any ideas?
i just came across old posts on how to use the xmlrpc/server lib from ruby-core, but i think maybe there are other ways to achieve the same here?
If you have to deal with some RESTful external api's, just use ActiveResource.
You can find a great railscast about this:
ActiveResource Basics
More on ActiveResource

Which Ruby gems support the Facebook API?

I have a rails application using the Facebook API. I've seen several different Ruby gems for integrating with Facebook, but they look dated.
Is it best to write low-level calls myself? Is there a decent and current gem available?
Have any of these gems changed recently?
I'm beginning a new project -- which gem should I use as of September, 2012?
The Koala Gem is the way to go.
These Railscasts from July will tell you all you need to know about interacting with the Social Graph in Ruby and in Rails (both are paid episodes):
#361: Facebook Graph API: Learn how to use the Facebook Graph API with the Koala gem to fetch data from Facebook and post content through a user. Here I delve into permissions, error handling, and more.
#363: Facebook Open Graph: This episode builds on last week's episodes and shows how to integrate Facebook further through the Open Graph protocol. You will also learn how to tunnel your local server and move Facebook communication into a background process.
Having used it quite recently, I'd suggest Koala too. Pretty well documented, goes through the changes in api pretty smoothly, still maintained, and arsduo is a pretty cool guy.
According to this link,
With Facebook’s Graph API and the creation of the Open Graph protocol, it is now easier then ever before to read and write data from and to the “social graph”.
...
The following are proven to work with Ruby 1.9.x and Rails 3.0.0.
Gems
Cardinal Blue’s rest-graph
miniFB
FBGraph
Koala
Mogli
Plugins - Facebooker2
Middlewares
OmniAuth
rack-facebook
I would suggest either mogli or koala.
One known to have an active user base is facebooker2. The documentation is not really sufficient right now but its mailing list is very active, you get responses pretty quickly.
I've dug into the Koala deeply for my project, and I found it to be well written, solid code that has full test coverage. The main author, Alex Koppel, definitely knows what he's doing and he cares about the developer community. I needed to make a few improvements, which was easy thanks to the good architecture of the gem, and Alex was helpful in merging the changes into the master branch. Highly recommended.
The oauth2 from Intridea supports Facebook's Graph API.
Blog Post: http://intridea.com/2010/4/22/oauth2-gem-just-in-time-for-facebook-graph?blog=company
On github: http://github.com/intridea/oauth2
The sample source of Heroku's facebook application was used mogli,but now is koala.It is the best and great gem.Have a good group -- koala-users

Resources