Facebook/Twitter share button - specify url - ruby-on-rails

I'm trying to implement Facebook share (not like) and Twitter tweet buttons into my Rails 3 app. I've looked at a couple different gems (shareable, facebook_share, social-buttons, social-share button etc.) but they don't quite fit the bill. I want the button to be a real share button, not a like button. I also want to be able to specify the url. Does anyone know of a good gem to accomplish this?
Alternatively, how tough is it to role your own for something like this?

Koala and Twitter gem fit the bill pretty well.
They are a wrapper on top of their respective API's so you have maximum control over what you want to do.
https://github.com/arsduo/koala
https://github.com/sferik/twitter

Related

Ruby on Rails: Simple share button by koala gem

I want to do a simple facebook share button in Ruby on Rails app using koala gem.
The button should be very simple - like this
<a href="https://www.facebook.com/sharer/sharer.php?u=example.org" target="_blank">
Share on Facebook
</a>
I would like to click on it and then should be opened new browser window to put post on my wall (or login to facebook).
I'm beginner in koala gem so I don't know how to do this. Until know I add to controller show method
# part of object_controller.rb
def
#graph = Koala::Facebook::API.
end
and on the view
# part of show.html.erb
<%=graph.put_wall_post("hey, i'm learning koala")%>
but it wants the token access and I think that there is a better (simpler) solution.
The easiest way I have found to add social links from many sites, including the Facebook share button is using the gem 'social-share-buttom'.
Here is a great little tutorial to start using it immediately in your Rails app.
https://richonrails.com/articles/adding-social-sharing-buttons-to-your-rails-app
Koala gem is a realy powerfull tool. If you want just add a share button use more simplest ways: a lot info about share buttons.
But if you want to do some specific just write about it, I will try to help you.

Facebook like user search as you type

I am creating a messaging system for my web app and need help with searching for users to send messages to. So far I have it so that if you type a persons name (who is on the site) you can send a message to them. I want it to be as you start typing a persons name, a drop down appears with users names that the current user is following. Any thoughts on how I can do this?
I am using the gem mailboxer also wondering if anyone has suggestions for a better messaging gem. Thanks in advance.
Use jQuery autocomplete, and just populate the dropdown contents as all users that the user is following... something like current_user.followed_users. It's impossible to give code without seeing how your code works though.
A good alternative to jquery autocomplete is http://loopj.com/jquery-tokeninput/ and github at: https://github.com/loopj/jquery-tokeninput. A facebook like tagging to send message to multiple users. A demo app on https://github.com/railscasts/258-token-fields-revised/tree/master/bookstore-tokeninput-after from Ryan Bates from Railscasts http://railscasts.com/episodes/258-token-fields-revised
Good luck.

Display a list of twitter accounts with twitter controls/info

I have some lists of twitter accounts that I would like to recommend on my website (e.g. follow these great crafting bloggers). If I have the twitter ID for each of these people, is it possible to create a list of items that show their twitter info (pic, number of tweets/followers, etc.) as well as controls that allow the user to follow each (or multiple) twitter account? I'd like to be able to do it dynamically based on the list of accounts so that I can update the list and not have to redesign the page. I feel like I've seen this around the web before, but I don't see any widgets for doing it and I'm wondering how it's done.
(I would like to use javascript/jquery, but am pretty flexible here)
Thanks!
Jeff
I would first look at the Twitter API. You will find more information on how Twitter works, and you may find information applicable to what you want to accomplish on your website. It's a start, and there's no better place to start than the source itself.

How do I grab meta data from other websites and display on mine in ruby on rails?

When using FB or Google + I can paste a link of any website into the status update box and it will instant load information about that website with the option of flicking through thumbnail images.
How can I go about achieving this in ruby on rails? All my searches seem to bring up php methods on how to do this.
For grabbing video data info I use the Ruby Open Graph Protocol gem. Is there any thing for grabbing data the way FB and G+ do? If not is there a standard way this is done in rails/ruby, if so.. how is this done?
Kind regards
I think you're looking for something like oembed. I've found a gems for that, so I propose you to take look at it: https://github.com/judofyr/ruby-oembed or https://github.com/embedly/embedly-ruby
You should likely use a gem like http://nokogiri.org/
It allows you to work with a html page just as you would do with jQuery. Very handy.

Is there a method to programmatically add a website shortcut to the iPhone?

I am looking to add a button to my website which easily allows people to turn the site into a shortcut on their phone.
I'm looking to automate the actions shown here: http://www.simpleleapsoftware.com/blog/how-to-create-shortcuts-iphone-ipod-touch-115 for my users, specifically for my website.
I'm open to any alternative ideas of making the process of adding a link to my website less painful, if putting a button on the site is not the easiest way of doing things.
I know this isn't a very helpful answer, but I seriously, seriously doubt this is possible. If Apple were to allow such an action to be automated, i.e. by pressing a button on the site, then it would be trivial for malevolent websites to do it without any kind of authorization from the user. Have you ever heard of a site that automatically adds bookmarks, say on a desktop browser? To the best of my knowledge, it can't be done, and for good reasons. If the user wants a home screen button, they'll have to add it themselves. I think the best you can do is have a simple instructional graphic that shows the user how to do it for themselves.

Resources