Coder Social home page Coder Social logo

merefield / discourse-onebox-assistant Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 4.0 33 KB

Discourse plugin to provide alternative path for oneboxing crawl via 3rd party API to improve reliability of bringing back previews of external sites

License: GNU General Public License v2.0

Ruby 100.00%
discourse-plugin onebox

discourse-onebox-assistant's People

Contributors

merefield avatar

Stargazers

 avatar  avatar

Watchers

 avatar

discourse-onebox-assistant's Issues

Undefined Method 'warning'

Rails.logger.warning "ONEBOX ASSIST: the API returned nothing!!"

Started GET "/onebox?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPPSp8sJsbmM&refresh=false&category_id=1&topic_id=33" for [IP REMOVED] at 2021-01-17 20:44:24 +0000
Processing by OneboxController#show as HTML
Parameters: {"url"=>"https://www.youtube.com/watch?v=PPSp8sJsbmM", "refresh"=>"false", "category_id"=>"1", "topic_id"=>"33"}
Rendering text template
Rendered text template (Duration: 0.0ms | Allocations: 1)
Completed 418 in 27ms (Views: 2.0ms | ActiveRecord: 0.0ms | Allocations: 5487)
ONEBOX ASSIST: the url being sought from API is https://www.youtube.com/watch?v=PPSp8sJsbmM
Failed to onebox https://www.youtube.com/watch?v=PPSp8sJsbmM undefined method 'warning' for #Logster::Logger:0x00007f0925c0a988
Did you mean? warn ["/var/www/discourse/plugins/discourse-onebox-assistant/plugin.rb:114:in 'fetch_html_doc'", "/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/onebox-2.2.1/lib/onebox/engine/standard_embed.rb:75:in 'html_doc'", "/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/onebox-2.2.1/lib/onebox/engine/standard_embed.rb:83:in 'get_opengraph'", "/var/www/discourse/plugins/lazy-yt/plugin.rb:31:in 'to_html'", "/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/onebox-2.2.1/lib/onebox/preview.rb:51:in 'engine_html'", "/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/onebox-2.2.1/lib/onebox/preview.rb:22:in 'to_s'", "/var/www/discourse/plugins/discourse-onebox-assistant/plugin.rb:60:in 'block in external_onebox'", "/var/www/discourse/lib/cache.rb:94:in 'fetch'", "/var/www/discourse/plugins/discourse-onebox-assistant/plugin.rb:18:in 'external_onebox'", "/var/www/discourse/lib/oneboxer.rb:199:in 'onebox_raw'", "/var/www/discourse/lib/oneboxer.rb:44:in 'preview'", "/var/www/discourse/app/controllers/onebox_controller.rb:27:in 'block in show'", "/var/www/discourse/lib/hijack.rb:56:in 'instance_eval'", "/var/www/discourse/lib/hijack.rb:56:in 'block in hijack'", "/var/www/discourse/lib/scheduler/defer.rb:94:in 'block in do_work'", "/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-2.5.0/lib/rails_multisite/connection_management.rb:76:in 'with_connection'", "/var/www/discourse/lib/scheduler/defer.rb:89:in 'do_work'", "/var/www/discourse/lib/scheduler/defer.rb:79:in 'block (2 levels) in start_thread'"]

Experiencing an issue with Oneboxing all URLs on our Discourse. I think the root cause is an issue with embed.rocks where we are getting a 418 Response which is pretty weird. However, the plugin code tries to print the error to Rails.logger.warning which throws the above undefined method error. This should probably be Rails.logger.warn, no?

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.