GithubHelp home page GithubHelp logo

greshny-attic / diffbot Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 19.0 70 KB

The ruby Diffbot API client

Home Page: http://www.diffbot.com/docs

License: MIT License

Ruby 100.00%
ruby diffbot diffbot-api article

diffbot's People

Contributors

alyssais avatar firefly21 avatar foca avatar greshny avatar reid-rigo avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

diffbot's Issues

Is the Global Index API available in this gem?

Diffbot has a "global index" API in beta where you can search for news by keyword: https://www.diffbot.com/dev/docs/global-index/

Am I correct in assuming it's not covered in the gem at this time? The interesting thing is that I did see Diffbot::Search return a result. I'm just not sure if there's a method that will execute the search.

> x = Diffbot::Search.new(ENV['DIFFBOT_TOKEN'])
=> #<Search:0x00007fcde2a51ad8 @current_user="my_token_is_shown_here", @query=nil, @sections=[], @params={}, @options={}>
> x.query = 'Apple Inc'
=> "Apple Inc"
> x # note that @query is now set below
=> #<Search:0x00007fcde2a51ad8 @current_user="my_token_is_shown_here", @query="Apple Inc", @sections=[], @params={}, @options={}>
> x.methods.sort
=> [:!, :!=, :!~, :<=>, :==, :===, :=~, :__binding__, :__id__, :__send__, :`, :acts_like?, :admin?, :articles, :as_json, :blank?, :bullet_key, :byebug, :categories, :class, :class_eval, :clone, :companies, :current_user, :current_user=, :customers, :dclone, :debugger, :deep_dup, :define_singleton_method, :display, :dup, :duplicable?, :enum_for, :eql?, :equal?, :extend, :freeze, :friendly_id?, :frozen?, :gem, :hash, :html_safe?, :in?, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_values, :instance_variable_defined?, :instance_variable_get, :instance_variable_names, :instance_variable_set, :instance_variables, :is_a?, :is_haml?, :itself, :kind_of?, :load_dependency, :mappings, :method, :methods, :nil?, :object_id, :options, :options=, :params, :params=, :presence, :presence_in, :present?, :pretty_inspect, :pretty_print, :pretty_print_cycle, :pretty_print_inspect, :pretty_print_instance_variables, :primary_key_value, :private_methods, :protected_methods, :pry, :psych_to_yaml, :public_method, :public_methods, :public_send, :query, :query=, :remove_instance_variable, :require_dependency, :require_or_load, :respond_to?, :results, :section, :section=, :sections, :sections=, :send, :singleton_class, :singleton_method, :singleton_methods, :solr_search?, :suppress_warnings, :taint, :tainted?, :tap, :to_enum, :to_json, :to_param, :to_query, :to_ruby, :to_s, :to_v8, :to_yaml, :to_yaml_properties, :trust, :try, :try!, :unfriendly_id?, :unloadable, :untaint, :untrust, :untrusted?, :users, :vendor_consultants, :vendor_products, :vendors, :with_options]

NoMethodError on Diffbot::Article

Hi,

I'm currently trying to make your gem working.

By following your documentation, I do :

require 'diffbot'

Diffbot::Article.fetch(url, ENV['DIFFBOT_API']) do |request|
  request.html = true # Return HTML instead of plain text.
  request.summary = true # Return a summary text instead of the full text.
end

That returns :

NoMethodError:
  The property 'nextPage' is not defined for Diffbot::Article.

Maybe the Diffbot API changed since issue #1 and its fix ?

Regards

Problem with Hashie 3.5

Hi there, we're not able to upgrade to Hashie 3.5.1 (which improves compatibility with Ruby 2.4) because of the following issue:

/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'diffbot'.
Gem Load Error is: uninitialized constant Hashie::Extensions::Coercion::RubyVersion
Did you mean?  RUBY_VERSION

Using Hashie 3.4.6 is fine though. Any idea how to fix the problem? Is the diffbot gem compatible with ruby 2.4? Thanks!

Diffbot breaks when used with Hashie versions >= 3.0.0

    Diffbot::Article.fetch(@url,diffbot_token)

Above code works fine with Hashie versions till 2.1.2. However refuses to play with Hashie version 3.0.0 onwards instead raising following error -

/usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/trash.rb:80:in `property_exists?': The property 'tags' is not defined for this Trash. (NoMethodError)
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/trash.rb:49:in `[]='
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/diffbot-0.1.7/lib/diffbot/coercible_hash.rb:58:in `[]='
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/dash.rb:149:in `block in initialize_attributes'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/dash.rb:148:in `each_pair'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/dash.rb:148:in `initialize_attributes'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/trash.rb:96:in `initialize_attributes'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/hashie-3.0.0/lib/hashie/dash.rb:93:in `initialize'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/diffbot-0.1.7/lib/diffbot/article.rb:41:in `new'
    from /usr/local/rvm/gems/ruby-2.1.2@global/gems/diffbot-0.1.7/lib/diffbot/article.rb:41:in `fetch'
    from listbot.rb:9:in `initialize'

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.