Coder Social home page Coder Social logo

fgraph's People

Contributors

jugend avatar khanhnguyen avatar omnibus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fgraph's Issues

error when oauth url has pipe

Hi Im using ruby 1.8.7 and rails 2.3.5, last night in our nighly run had some facebook issues and in debugging them it seems that line 65 of fgraph.rb does this:

uri = URI.parse(url)

This will barf if your url has a pipe ("|") in it

I did some digging and this seems to work and not have any big issues so far:

uri = URI.parse(URI.encode(url))

Sorry I dont know git well enough to give you a proper patch.

thanks
Joel

rake fgraph:setup fails for gem

I tried to install it as a plugin under Rails 2.2.2 but it wouldn't install, just hangs, so I tried to install as a gem, but the fgraph:setup rake task failed as it was looking for the config file in the plugin folder.

I copied the file manually from the gem and it seems to be working fine.

Thanks for the plugin!

Results from "comments" request are sometimes Arrays instead of Hashes

Hi, I've run into a strange issue that could be related to Facebook's Graph API or could be related to this gem.

Basically, when I make a request for a post's comments, sometimes I get a Hash and other times I seem to get an array. The code that makes the request and processes the comment is below.

The reason I know this is what's happening is that I'm getting an error on this line: from = comment["from"] about how I can't convert String to Fixnum so I'm assuming that the comment object is an indexed Array at that point.

You can see that I've added some code that will skip comments that aren't Hashes to avoid this problem but I'm curious about why it might be happening.

Thanks!

def read_feed
  client.object("#{self.facebook_page_id}/feed").each do |item|
    next unless item.is_a?(Hash)
    message = do_something_with_feed_item_hash(item)

    client.object("#{item["id"]}/comments").each do |comment|
      next unless comment.is_a?(Hash)
      do_something_with_comment_hash(comment)
    end
  end
end

def do_something_with_comment_hash(comment)
  from = comment["from"]
end

rails 3.0.3

helpers are not defined when installed as a gem with bundler, when used as a plugin its fine

Issue Abuse in the name of Gratitude

I'm just going through my GemFiles and thanking developers for gems that I use and love. I use fgraph in a couple apps without issue. The API follows very closely to the graph API so it is easy to understand.

Thanks for your contributions to Open Source!

Please close this non-issue immediately :)

rake task issue

Might be a typo for fgraph_config_teirmplate; must it be fgraph_config_template?

Best way to get data from videos

Hi,

I have been using fgraph and its great, thank you very much for providing it.

I have a question, maybe about the best way to use it, because it seems like im making things harder than it should be.

For example, if I wanted to get the video responses to a video and their count, here is what im doing today:
links = videos[9].attributes['link']
links.each{|link|
if link.attributes['href'].include?("responses")
response_link = link.attributes['rel']
end
}

Now I have a response link, something like:
http://gdata.youtube.com/feeds/api/videos/4sK-vEnLEUQ/responses
Then I need to get that list somehow and count them.

Im sure there is a much better way.
thanks
Joel

(OAuthException) Error processing access token.

I've used login button and than I've logged out from facebook on facebook site and than when refreshed my page I've got

/home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph.rb:330:in handle_response' /home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph.rb:308:inperform_get'
/home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph.rb:98:in object' /home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph.rb:148:inme'
/home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph/client.rb:59:in me' /home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph/rails/fgraph_helper.rb:65:infgraph_current_user'
/home/webrail/www/.ruby/gems/1.8/gems/fgraph-0.3.1/lib/fgraph/rails/fgraph_helper.rb:70:in `fgraph_user'

in:

16: <% if fgraph_logged_in? %>
17:
Hello <%= fgraph_user['name'] %>,

so it seems that fgraph_logged_in? returns true even when fgraph_user is empty
when I delete manually cookie fbs_xxxxxxxxxxxx error disappears

confllict with desert plugin?

Hi, when using fgraph (as plugin or gem) in rails in combination with the desert plugin, i get this error returned:

/home/cm/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:3:in require_with_desert': undefined method=~' for #Pathname:0x000000026e9ae0 (NoMethodError)
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/httparty-0.6.1/lib/httparty.rb:10:in <top (required)>' from <internal:lib/rubygems/custom_require>:33:inrequire'
from internal:lib/rubygems/custom_require:33:in rescue in require' from <internal:lib/rubygems/custom_require>:29:inrequire'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in block in require' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:8:inblock in require_with_desert'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:32:in __each_matching_file' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:7:inrequire_with_desert'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/plugins/fgraph/lib/fgraph.rb:1:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:inrequire'
from internal:lib/rubygems/custom_require:29:in require' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inblock in require'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:8:in block in require_with_desert' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:28:inblock in __each_matching_file'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:27:in each' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:27:in__each_matching_file'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/ruby/object.rb:7:in require_with_desert' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/plugins/fgraph/rails/init.rb:1:inblock in evaluate_init_rb'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin.rb:158:in eval' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin.rb:158:inblock in evaluate_init_rb'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in silence_warnings' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin.rb:154:inevaluate_init_rb'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin.rb:48:in load' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/rails/2.0.0/plugin.rb:16:inblock in load_with_desert'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/manager.rb:47:in register_plugin' from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/manager.rb:11:inmethod_missing'
from /home/cmager/.rvm/gems/ruby-1.9.2-p0/gems/desert-0.5.4/lib/desert/rails/2.0.0/plugin.rb:15:in load_with_desert' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin/loader.rb:38:inblock in load_plugins'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin/loader.rb:37:in each' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/rails/plugin/loader.rb:37:inload_plugins'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/initializer.rb:369:in load_plugins' from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/initializer.rb:165:inprocess'
from /home/cm/rails/xxxxxxxxxxxxxxx/vendor/rails/railties/lib/initializer.rb:113:in run' from /home/cm/rails/xxxxxxxxxxxxxxx/config/environment.rb:9:in<top (required)>'
from internal:lib/rubygems/custom_require:29:in require' from <internal:lib/rubygems/custom_require>:29:inrequire'
from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:281:in block in load_modules' from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:ineach'
from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:in load_modules' from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:20:insetup'
from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb.rb:53:in start' from /home/cmager/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in

'

same issue when using the httparty plugin in version 0.5.2... any ideas?

cheers chris

FGraph::OAuthError in SessionController#oauth_callback

When calling FGraph::oauth_access_token as given by the examples, the call results into an Exception saying "(OAuthException) Error validating verification code."

As the rails webserver console says, the error is the result of the following Exception:

--- begin ---
MultiJson::DecodeError (706: unexpected token at 'access_token=XXXXXREMOVEDXXXXXX'):
app/controllers/session_controller.rb:23:in `oauth_callback'

Rendered httparty/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
Rendered httparty/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms)
Rendered httparty/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (12.0ms)
--- end ---

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.