Giter Club home page Giter Club logo

nodebb-plugin-iframely's Introduction

Iframely for NodeBB

Iframely will give you embeds from over 1700 domains, plus previews for the rest of the web. Powered by remote API.

Here's how it looks:

Screenshot

Try your URLs at iframely.com/debug to see how it is supported.

Features

  • YouTube, Vimeo, SoundCloud, Gists, Twitter, Facebook, Instagrams, Google Maps, Imgur, Giphy, GfyCat, Flickr - you name it. Plus, articles and general links.
  • URL previews automatically collapse if post gets downvoted a lot.
  • Embed codes will be responsive and will look great on any device.
  • You can use it with API key via cloud service, or self-host the open-source version
  • Optionally use Camo Image Proxy to avoid image hot-linking and mixed-content warnings in SSL.

Contribute

PRs are welcome.

If you see a problem - please submit an issue.

The plugin is maintained by joint effort of Iframely and NodeBB.

nodebb-plugin-iframely's People

Contributors

arasbm avatar barisusakli avatar benlubar avatar boomzillawtf avatar iparamonau avatar julianlam avatar nleush avatar psychobunny avatar sjennison avatar sohrabafard avatar uplift avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodebb-plugin-iframely's Issues

is it compatible with latest master?

we could not make it work with 1.13.4-5... there is no errors in the log but none of the links are transformed...

should we wait for stable version ?

oEmbed fallback if IFramely returns a non-match

Currently we have a naive check to only process links if the html is present, which means we're only processing whitelisted domains at the moment (maybe even fewer than that).

Code should be updated so the response is always sent back (and cached), and some other logic should determine what should happen on a non-matching domain...

defaultLang not used

When switch to not supported language - default language from plugin.json not used.

How to enable youtube full screen view

One thing I can't figure out is how to get the full screen option to work. The full-screen button is always stippled out and when I click on it I get a "fullscreen unavaible message".

iframely works great, I think I'm going to use it in a lot of places

raw github content empty

Posting sth. like https://raw.githubusercontent.com/frissdiegurke/jquery-textcomplete/master/dist/jquery.textcomplete.js results in empty content.

Clickable images from external URL

https://community.nodebb.org/topic/8312/zenith-v1-preview

Click on image created from URL (http://convoe.com) to open http://convoe.com/uploads/system/site-logo.png image in a new window.

<a href="http://convoe.com/uploads/system/site-logo.png" target="_blank"><img src="http://convoe.com/uploads/system/site-logo.png" class="img-responsive"></a>

Please remove a link as it sometimes redirect to a random page and not showing an image. I mean when posting some other URLs.

Have a whitelist of domains that can use the iframely API

Using the commercial version of iframely is expensive. I racked up 1000 hits in just a few hours.

I also have a self hosted version, but that doesn't render things as nicely as the real API.

It would be nice to be able to whitelist the domains that would use the real API, and have others use the self hosted.

It would also be nice to have a hook where the resulting html can be preprocessed (when they do iframes for example, and we have no way to changing them after the fact).

Processing error: HPE_INVALID_METHOD

Hello

I have iFramely running in localhost and nodebb-plugin.iframely also. After upgrade nodejs to 10.x I get these error messages on all links in nodebb forum.

This is one example, and there is no render for the link, only as legacy <a href.

[plugin/iframely] iframely responded with error: {"error":{"source":"iframely","code":417,"message":"Processing error: HPE_INVALID_METHOD"}}. Url: http://www.tortasycocteles.com/shop/index.php?id_category=50&amp;controller=category. Api call: https://iframely.vapeandoargentina.com.ar/iframely?url=http%3A%2F%2Fwww.tortasycocteles.com%2Fshop%2Findex.php%3Fid_category%3D50%26amp%3Bcontroller%3Dcategory&group=true

Can I do something to fix this issue? Before nodejs upgrade runs ok.

NodeJS v10.4.1
NodeBB: v1.10.1
nodebb-plugin-iframely: 0.7.8
iframely: 1.2.5

Regards,
Normando Hall

TypeError: Cannot read property 'thumbnail' of undefined

Upon swapping from iframe.ly to self-hosted iframely instance, nodebb keeps crashing with:

15/6 11:09 [26918] - error: TypeError: Cannot read property 'thumbnail' of undefined
at getImage (/root/nodebb/node_modules/nodebb-plugin-iframely/library.js:474:26)
at /root/nodebb/node_modules/nodebb-plugin-iframely/library.js:143:19
at /root/nodebb/node_modules/async/lib/async.js:375:13
at iterate (/root/nodebb/node_modules/async/lib/async.js:262:13)
at Object.async.forEachOfSeries.async.eachOfSeries (/root/nodebb/node_modules/async/lib/async.js:281:9)
at Object.async.inject.async.foldl.async.reduce (/root/nodebb/node_modules/async/lib/async.js:374:15)
at /root/nodebb/node_modules/nodebb-plugin-iframely/library.js:133:11
at fn (/root/nodebb/node_modules/async/lib/async.js:746:34)
at /root/nodebb/node_modules/async/lib/async.js:1213:16
at /root/nodebb/node_modules/async/lib/async.js:166:37

The endpoint address is specified as "http://w.x.y.z:8061". Interestingly, server logs do not show a successful request, however I presume this is correctly configured because if the address is incorrect or lacking the http://, nothing happens.

I'm quite confused by this, because if I query the backend manually, I do get the thumbnail populated.

Server crash after installing this plugin


30/9 19:15 [9350] - info: Time: Wed Sep 30 2015 19:15:17 GMT+0200 (CEST)
30/9 19:15 [9350] - info: Initializing NodeBB v0.8.2
30/9 19:15 [9350] - verbose: * using configuration stored in: /root/NBB/config.json
30/9 19:15 [9350] - verbose: * using redis store at 127.0.0.1:6379
30/9 19:15 [9350] - verbose: * using themes stored in: /root/NBB/node_modules
Warning: Redis server does not require a password, but a password was supplied.
30/9 19:15 [9350] - verbose: Checking dependencies for outdated modules
Warning: Redis server does not require a password, but a password was supplied.
Warning: Redis server does not require a password, but a password was supplied.
30/9 19:15 [9350] - verbose: [notifications.init] Registering jobs.
Warning: Redis server does not require a password, but a password was supplied.
Warning: Redis server does not require a password, but a password was supplied.
30/9 19:15 [9350] - info: [themes] Using theme nodebb-theme-persona
30/9 19:15 [9350] - verbose: [plugins] Initializing plugins system
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-dbsearch
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-markdown
30/9 19:15 [9350] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-plugin-markdown
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-markdown
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-mentions
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-mentions
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-mentions
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-google-analytics
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-google-analytics
30/9 19:15 [9350] - verbose: [plugins] Found 1 css file(s) for plugin nodebb-widget-essentials
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-widget-essentials
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-rewards-essentials
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-rewards-essentials
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-soundpack-default
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-emoji-extended
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-emoji-extended
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-emoji-extended
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-spam-be-gone
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-spam-be-gone
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-spam-be-gone
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-desktop-notifications
30/9 19:15 [9350] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-plugin-desktop-notifications
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-desktop-notifications
30/9 19:15 [9350] - verbose: [plugins] Found 1 css file(s) for plugin nodebb-plugin-youtube
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-youtube
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-question-and-answer
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-question-and-answer
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-question-and-answer
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-imgur
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-recent-cards
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-recent-cards
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-recent-cards
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-emailer-mandrill
30/9 19:15 [9350] - warn: [plugins/nodebb-plugin-sso-facebook] Hook `filter:user.delete` is deprecated, please use an alternative
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-sso-facebook
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-sso-facebook
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-composer-default
30/9 19:15 [9350] - verbose: [plugins] Found 10 js file(s) for plugin nodebb-plugin-composer-default
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-composer-default
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-custom-pages
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-custom-pages
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-custom-pages
30/9 19:15 [9350] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-iframely
30/9 19:15 [9350] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-iframely
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-plugin-iframely
30/9 19:15 [9350] - verbose: [plugins] Found 4 js file(s) for plugin nodebb-theme-persona
30/9 19:15 [9350] - verbose: [plugins] Loaded plugin: nodebb-theme-persona

30/9 19:15 [9350] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
  * nodebb-plugin-desktop-notifications
  * nodebb-plugin-youtube

30/9 19:15 [9350] - info: [plugins] Plugins OK
30/9 19:15 [9350] - verbose: [meta/css] Minifying LESS/CSS
30/9 19:15 [9350] - verbose: [sounds] Sounds OK
30/9 19:15 [9350] - verbose: [meta/templates] Compiling templates
30/9 19:15 [9350] - verbose: [meta/templates] Successfully compiled templates.
30/9 19:15 [9350] - verbose: [meta/css] admin.css committed to disk.
30/9 19:15 [9350] - verbose: [meta/js] Minification complete
30/9 19:15 [9350] - verbose: [hotswap] Router with id `auth` replaced successfully
30/9 19:15 [9350] - verbose: [meta/css] stylesheet.css committed to disk.
30/9 19:15 [9350] - info: [plugins/spam-be-gone] Settings loaded
30/9 19:15 [9350] - verbose: [hotswap] Router with id `plugins` replaced successfully
30/9 19:15 [9350] - verbose: [plugins] All plugins reloaded and rerouted
30/9 19:15 [9350] - error: TypeError: Cannot call method 'split' of undefined
    at /root/NBB/node_modules/nodebb-plugin-iframely/library.js:36:39
    at /root/NBB/src/meta/settings.js:12:4
    at try_callback (/root/NBB/node_modules/redis/index.js:573:9)
    at RedisClient.return_reply (/root/NBB/node_modules/redis/index.js:661:13)
    at ReplyParser.<anonymous> (/root/NBB/node_modules/redis/index.js:309:14)
    at ReplyParser.emit (events.js:95:17)
    at ReplyParser.send_reply (/root/NBB/node_modules/redis/lib/parser/javascript.js:300:10)
    at ReplyParser.execute (/root/NBB/node_modules/redis/lib/parser/javascript.js:211:22)
    at RedisClient.on_data (/root/NBB/node_modules/redis/index.js:534:27)
    at Socket.<anonymous> (/root/NBB/node_modules/redis/index.js:91:14)
3 restarts in 10 seconds, most likely an error on startup. Halting.

Please fix. Thanks 👍

Cloud vs. Self-hosted

I am getting significant difference in the output of the iFramely API VS. the self hosted versions as shown in screens below.
Is the difference in look what I am supposed to get or am I missing something in the config of the plugin - please let me know your thoughts.

Thanks!

Cloud Version;
Screen Shot 2019-09-02 at 23 19 19

Self Hosted version;
Screen Shot 2019-09-02 at 23 19 09

change cache length in the ACP

As is, the plugin is configured to cache iframely data for one day. This leads to a huge amount of API hits. It is possible to manually change the cache length via this line (https://github.com/NodeBB/nodebb-plugin-iframely/blob/master/library.js#L21-L23)

I'd suggest adding a configurable option on the ACP to change how long iframely caches information.

I found that setting it to seven days doesn't consume too much memory and bumped me down from ~20K hits to ~10K, which is huge.

New NPM release?

Is it possible to push the latest version of this plugin to NPM to pick up this change - #50. The NPM version says its 0.7.14 the release prior to this change so I'm assuming it needs another push to NPM?

Bad URI causes crash

When the plugin processes the following:
<a href="mailto:anoy%*@(*&amp;#...&lt;NO">anoy%*@(*&amp;#...&lt;NO</a>

...it crashes:

2/6 08:47 [11950] - error: URIError: URI malformed
    at decodeURIComponent (native)
    at Url.parse (url.js:195:19)
    at Object.urlParse [as parse] (url.js:84:5)
    at Object.iframely.replace (/home/boomzilla/nodebb/node_modules/nodebb-plugin-iframely/library.js:105:21)
    at Object.iframely.replace [as method] (/home/boomzilla/nodebb/node_modules/nodebb-plugin-iframely/library.js:79:12)
    at /home/boomzilla/nodebb/src/plugins/hooks.js:134:12
    at /home/boomzilla/nodebb/node_modules/async/lib/async.js:375:13
    at Immediate.iterate [as _onImmediate] (/home/boomzilla/nodebb/node_modules/async/lib/async.js:262:13)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Ignore links back to self

A forum running at example.org shouldn't unfurl links to example.org... or should it? 😄

Open to discussion, but I feel this should be disabled and opt-in if desired.

[plugin/iframely] Could not parse embed! TypeError: This library (validator.js) validates strings only

24/7 14:51:42 [3641] - error: [4568/3641] [plugin/iframely] Could not parse embed! TypeError: This library (validator.js) validates strings only
24/7 14:51:42 [3641] - error: [4568/3641]  Error: Callback was already called.
    at /usr/src/app/node_modules/async/dist/async.js:903:32
    at /usr/src/app/node_modules/async/dist/async.js:1071:13
    at Immediate.<anonymous> (/usr/src/app/node_modules/nodebb-plugin-iframely/library.js:310:5)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

https://github.com/NodeBB/nodebb-plugin-iframely/blob/72bd373dc4dcc74ec9a6783d50d9cb2cae134d37/library.js#L310

Don't have time to look into it further right now, but I'll look later today if I have time.

[plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined

I have iframely installed and run like a charm. But iframely plugin get errors on all posts I have youtube video. Of course I was disabled all youtube plugins.

I get these errors:

13/8 03:27:55 [3631] - error: [plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined
13/8 03:27:55 [3631] - error: [plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined
13/8 03:27:58 [3612] - error: [plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined
13/8 03:27:58 [3612] - error: [plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined
13/8 03:28:08 [3631] - error: [plugin/iframely] Could not parse embed! TypeError: Cannot read property 'thumbnail' of undefined
13/8 03:28:08 [3631] - error:  Error: Callback was already called.
    at /opt/vapor/nodebb/node_modules/async/dist/async.js:903:32
    at /opt/vapor/nodebb/node_modules/async/dist/async.js:1071:13
    at Immediate.<anonymous> (/opt/vapor/nodebb/node_modules/nodebb-plugin-iframely/library.js:310:5)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

NodeJS: v7.10
NodeBB: v1.5.3

Some help?

Regards

remove old iframely embeds

In an effort to cut down on the number of hits on the Iframely API, it would be great if posts older than a specified age removed the embed. This might help cut down on long threads with lots of embeds triggering 20+ API calls.

iframely-container size

Just a feature request:

It would be nice to have an option in the admin panel to set max width of the iframely-container.

Cheers!

Option to embed urls with a special class or a attribute?

Hi,

I really love a iframely with nodeBB. I have to say "thank you" first.
But the only problem is that it embed every naked URLs and sometimes it's so messy.

Is it possible I can get a option to specify a class or attribute of link (<a> tag) to embed?
I know in nodeBB, naked URLs doesn't have chance to have a special class or a attribute.
However plugins can do that and my nodebb-plugin-magicblock is one of it.

Actually I'm using my nodeBB with a bittly modified nodebb-plugin-iframely ( just 2 lines so not universal ) but I wish that offical plugin support this.

-QGP9

Why no lazyload?

Hmm? Why?

Seems silly having a blazing fast platform, then spending 15 seconds waiting for images and videos to load on a page. :)

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.