[nodebb-plugin-iframely] IFramely Embeds


  • Global Moderator

    @teh_g sounds like a good idea to me, too. Maybe allow for customizing the time it takes for embeds to expire in the settings.



  • @PitaJ said in [nodebb-plugin-iframely] IFramely Embeds:

    @teh_g sounds like a good idea to me, too. Maybe allow for customizing the time it takes for embeds to expire in the settings.

    I have no dev talent, or I'd offer to help. I absolutely would love this. My costs for Iframely have slowly been going up...



  • @teh_g said in [nodebb-plugin-iframely] IFramely Embeds:

    @PitaJ said in [nodebb-plugin-iframely] IFramely Embeds:

    @teh_g sounds like a good idea to me, too. Maybe allow for customizing the time it takes for embeds to expire in the settings.

    I have no dev talent, or I'd offer to help. I absolutely would love this. My costs for Iframely have slowly been going up...

    Why don't you just self host it?



  • @torn2 said in [nodebb-plugin-iframely] IFramely Embeds:

    Why don't you just self host it?

    Mostly laziness. I can't find a good document for setting up Camo with Iframely, and I don't have the time to fuddle with getting it working. The cost of the cloud hosting is also relatively cheap compared to the cost of spinning up a server to host the services myself.


  • FreeBSD/OpenBSD

    Hello,

    I am self hosting Iframely. It works as expected except the way some embedded media are displayed. You can find an example (on my testing server) here : https://forum.zqsd.fr:6664/topic/166/les-bon-plans-pc/161

    To be more specific, here is what I obtain with no custom CSS (nodebb v1.1.1):
    0_1479471358076_iframelysans.png

    As you can see from the picture, the max-width: 21px !important is not applied because of the max-width: 100% !important. If I deactivate this later rule, I obtain what I would expect to see normally.
    0_1479471320057_iframelyavec.png

    I am not a CSS guru, and since both rules are using !important, I have hard time finding how to get ride of them with custom CSS. Last thing in case it helps, these rules are coming from the iframely plugin :
    https://github.com/NodeBB/nodebb-plugin-iframely/blob/master/static/style.less

    Any help would be greatly appreciated.

    Edit :
    Same post here :https://community.nodebb.org/topic/9856/iframely-test/2


  • Global Moderator

    @hukadan you should be able to do something like

    .iframely-link .iframely-container img.thumb {
      max-width: 21px;
    }
    

    CSS follows specificity. More specific rules are given precedence.


  • FreeBSD/OpenBSD

    @PitaJ said in [nodebb-plugin-iframely] IFramely Embeds:

    @hukadan you should be able to do something like

    .iframely-link .iframely-container img.thumb {
      max-width: 21px;
    }
    

    Thank you for your answer but it did not work.

    CSS follows specificity. More specific rules are given precedence.

    My understanding of the !important parameter is that it breaks the cascading behaviour and that it is precisely why I can't find a way to modify this using custom CSS. Is this interpretation of the !important parameter wrong ? Why does it work properly here and not on my test forum ?


  • Global Moderator

    @hukadan sorry about that, looks like I forgot an important:

    .iframely-link .iframely-container img.thumb {
      max-width: 21px !important;
    }
    

    Important is just another layer of specificity. It can override all lower layers, but if two things are both important, the specificity takes hold again. Is your site public? I'm in a helpful mood, and I'd be glad to make it work for you.


  • FreeBSD/OpenBSD

    I would have bet my house (if I had one) that I already tried what you just wrote. Apparently I did not. It works just fine now ! Thank you !

    Now, have you got any idea why the look is still different between my forum and here ? Does it use specific CSS settings for Iframely ?


  • Global Moderator

    @hukadan I honestly have no idea. I could compare the CSS for you if you want.


  • FreeBSD/OpenBSD

    In my case the only CSS (on the test server) is the one you just wrote.


  • FreeBSD/OpenBSD


  • FreeBSD/OpenBSD

    @PitaJ , reading again the thread, I think I find the answer.

    @torn2 said in [nodebb-plugin-iframely] IFramely Embeds:

    @boomzilla You have options on how the card may look when you use their hosting.

    So my guess is that NodeBB forum uses the Iframely service while I am self hosting.

    Thank you again, your help was appreciated.



  • @hukadan said in [nodebb-plugin-iframely] IFramely Embeds:

    So my guess is that NodeBB forum uses the Iframely service while I am self hosting.

    If they are using the service, I'd be curious about their usage stats. Maybe it would get them to implement some of the options I proposed to hide old embeds 😉



  • I hope I'm not posting this in the wrong location. I'm trying to run the self hosted iframely to use with my forum. It seems to work fine when I go to the end point of my server in a browser however, when the call is made from Nodebb using the plugin, I see this error in bash. The link is displayed as a normal url in the forum. I'm sure it's just me doing something dumb and not seeing the obvious.

    uri.match is not a function
    TypeError: res.sendJsonCached is not a function
    at respondWithError (/home/user/misc/iframely/app.js:97:9)
    at Object.errorHandler [as handle] (/home/user/misc/iframely/app.js:128:7)
    at next (/home/user/misc/iframely/node_modules/connect/lib/proto.js:185:17)
    at Object.logErrors [as handle] (/home/user/misc/iframely/app.js:58:3)
    at next (/home/user/misc/iframely/node_modules/connect/lib/proto.js:185:17)
    at next (/home/user/misc/iframely/node_modules/connect/lib/proto.js:187:11)
    at next (/home/user/misc/iframely/node_modules/connect/lib/proto.js:195:7)
    at Object.handle (/home/user/misc/iframely/app.js:37:3)
    at next (/home/user/misc/iframely/node_modules/connect/lib/proto.js:190:15)
    at multipart (/home/user/misc/iframely/node_modules/connect/lib/middleware/multipart.js:64:37)

    If this post belongs elsewhere feel free to shoo me along to the right spot.. Thanks for the help!



  • @boiserck feel free to open an issue on the repository for the project https://github.com/NodeBB/nodebb-plugin-iframely/issues



  • @teh_g said in [nodebb-plugin-iframely] IFramely Embeds:

    Something I've noticed in Iframely is that the number of API hits has been steadily increasing over time. I reached out to Iframely, and they noted that NodeBB appears to be making the majority of the API calls.

    I've taken a look at your hits, and as I see the more from API calls than from iFrames. It means your NodeBB is making the most hits.
    The way NodeBB folks have it implemented is that they keep the cache for 1 day in server's memory. If you restart the servers, for example, - the cache will be reset. Also, if your RAM is limited, some of the records can be evicted from cache prematurely.
    We did helped NodeBB team develop the plugin - but from the point where the link is already extracted and till the point before it needs to be stored. So, basically - connecting to API and UI is our part. However, if you have a pull-request for longer cache times or eliminating the older links - my team should be able to review, merge and push it to NPM.

    I am far from a developer, so I'll ask if you guys can take a look at the plugin and try and add some method of lowering API hits. Perhaps if a post is older than x days, don't attempt to cache the Iframely hit until someone loads that post. Maybe going a step further and removing the embed if the post is over a certain age.

    Any way to get traction on this?

    I actually go to a point where I tried (and failed terribly) to setup a camo proxy and iframely on a Digital Ocean droplet. I'd love to not have to stumble through trying that again and keep using the service from iFramely.


  • GNU/Linux Admin

    @teh_g Hmm... we didn't actually write the IFramely plugin. Most of the ongoing maintenance is handled by the iframely team themselves, so I'd raise the issue with them to see what the problem is.

    It could just be that as you have more content, you have more embeds, and those get loaded by your visitors?



  • @julian said in [nodebb-plugin-iframely] IFramely Embeds:

    @teh_g Hmm... we didn't actually write the IFramely plugin. Most of the ongoing maintenance is handled by the iframely team themselves, so I'd raise the issue with them to see what the problem is.

    When I asked them about it, they said that most of the hits were from API calls than from iFrames being loaded. This indicated to them that NodeBB is making most of the hits. Here is what they said as well:

    The way NodeBB folks have it implemented is that they keep the cache for 1 day in server's memory. If you restart the servers, for example, - the cache will be reset. Also, if your RAM is limited, some of the records can be evicted from cache prematurely.

    @julian said in [nodebb-plugin-iframely] IFramely Embeds:

    It could just be that as you have more content, you have more embeds, and those get loaded by your visitors?

    That could be a part of it, but that would be a big reason for wanting to age out older embeds. The more we can control for that, the better too. Beyond just age based, maybe add additional parameters, like "any age for first post", "only age out certain content", etc.


  • GNU/Linux Admin

    https://github.com/NodeBB/nodebb-plugin-iframely/blob/master/library.js#L21-L23

    The cache is indeed one day, though it can be changed to be a week, perhaps, if that is better in your opinion.

    However, if indeed your NodeBB is crashing often, then the cache is cleared, and it won't matter how far in the future the cache expiry is, since everything in it will be flushed and content pulled anew.

    So I have to ask, is your forum crashing often? 😄


Log in to reply
 

Suggested Topics

| |