Senior & Expert RoR Developers Discussion Forum by Nyros Technologies

HIRE Ruby on Rails Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Getting flickr user information from rails application

 
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
View previous topic :: View next topic  
Author Message
Raghu



Joined: 12 Mar 2009
Posts: 34

PostPosted: Tue Jul 28, 2009 11:59 am    Post subject: Getting flickr user information from rails application Reply with quote

Hi,

Here I would like to explain about, how to get the existing user information from the flickr account by using rails application.

Steps:

1) Create a sample rails application

> rails fleakr-demo

> gem install fleakr

> ruby script/generate controller users

(You may need to login to Flickr first.)
You must have an API key to make use of the Flickr API.

You can get api key below url
url: http://www.flickr.com/services/api/misc.api_keys.html

• Click on Apply for your api key
• Click on Apply for a Non-Commercial API Key
Once submitting all required information you will get the following API key and Secret

Sample
Key:
5c211baf9bd705496b21522132c80148
Secret:
bb6500467b1af07f

Click on - Edit key details and select the Authentication Type: Web Application.
Once all the settings have been completed its time to create and rails application.


Add this line in config/environment.rb
config.gem 'fleakr'

add the following line in config/initializers/fleakr.rb
Fleakr.api_key = 'your_api_key_here'


add the following code in your controller(user)
def show
@user = Fleakr.user(params[:username])
end


add the following show.html.erb file in views\users
<% @user.photos.each_slice(10) do |photos| %>
<div>
<% photos.each do |photo| %>
<%= link_to image_tag(photo.square.url),
photo.url,
:width => photo.square.width,
:height => photo.square.height %>
<% end %>
</div>
<% end %>

And now start your server, and try it:
http://localhost:3000/users


here it will display existing user contacts_list, groups, photos, photo_comments, etc.,
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts Chat utility in a ROR application
0 shobana 2 Thu Sep 09, 2010 9:45 am
shobana View latest post
No new posts How to customize Google Maps InfoWindow using ym4r_gm
0 kalyanallampalli 54 Thu Sep 02, 2010 5:34 pm
kalyanallampalli View latest post
No new posts Drag and Drop file upload
0 umamageshwari 51 Wed Sep 01, 2010 9:36 am
umamageshwari View latest post
No new posts Flex On Rails
0 Raghu 48 Wed Sep 01, 2010 3:00 am
Raghu View latest post
No new posts MongoDB
0 Raghu 45 Tue Aug 31, 2010 3:30 pm
Raghu View latest post
No new posts Problem with Dreamweaver / java error
3 Raja 37 Tue Aug 31, 2010 3:24 pm
Raghu View latest post
No new posts Generating Model
0 phani.galla 44 Tue Aug 31, 2010 2:09 pm
phani.galla View latest post
No new posts Hide Panels using JQuery
0 Anu 48 Tue Aug 31, 2010 1:50 pm
Anu View latest post
No new posts Load a text file using ajax in jquery
0 Anu 38 Tue Aug 31, 2010 1:39 pm
Anu View latest post
No new posts Generating Migrations
0 phani.galla 31 Tue Aug 31, 2010 1:38 pm
phani.galla View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More