[nodebb-widget-discord-embed] Embed a Discord chat in a widget using TitanEmbeds

NodeBB Plugins
  • A simple widget for embedding a Discord chat (not just an invite and a list of user online, like what Discord gives by itself) using TitanEmbeds.

    My main reason for creating this instead of just using a html widget with the iframe was the option to give guests their forum username by default (so with correct settings on TitanEmbeds they can be logged in as a guest with their username automatically).

    When creating the widget you need to input the embed/server ID from TitanEmbeds and you'll be able to configure almost all settings available for the iframe embed (default channel, theme, language, etc.).

    To install just find the widget in the plugin manager or use npm install nodebb-widget-discord-embed.

    Source code can be found here

  • Awesome work! Always nice to see new widgets be created 😄


Suggested Topics


  • 0 Votes
    2 Posts
    979 Views

    @jiangcaiyang the error you posted points to client-side code. The code you posted is pretty clearly server-side.

  • 0 Votes
    1 Posts
    1k Views

    Hello,

    I'm working on a SSO integration from a django SSO.
    In my django project i add 'oauth2_provider'

    Welcome to Django OAuth Toolkit Documentation — Django OAuth Toolkit 2.3.0 documentation

    favicon

    (django-oauth-toolkit.readthedocs.io)

    And i get this :

    0_1512387850634_ad046269-f481-410a-bc24-2ca89b39f6dd-image.png

    On the nodebb side, I started from the plugin
    https://github.com/julianlam/nodebb-plugin-sso-oauth

    Which I modified as a result:

    The config.json file

    "oauth": { "id": "rs2yEx7aqrj7ZIgVRC9IFL7p0DyIjQwWPST4BqVW", "secret": "6A678EDFqAYtl0sALS5rqk2mfhlBQi0HIgoGH5mPaeIpnZGni8BdOFiv" },

    and in the library.js) i change this lignes

    var constants = Object.freeze({ type: 'oauth2', // Either 'oauth' or 'oauth2' name: 'nodebb_django', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb" oauth: { requestTokenURL: '', accessTokenURL: '', userAuthorizationURL: '', consumerKey: nconf.get('oauth:key'), // don't change this line consumerSecret: nconf.get('oauth:secret'), // don't change this line }, oauth2: { authorizationURL: 'https://beta.esprit-bourse.com/oauth/authorize', tokenURL: 'https://beta.esprit-bourse.com/oauth/token', clientID: nconf.get('oauth:id'), // don't change this line clientSecret: nconf.get('oauth:secret'), // don't change this line }, userRoute: '' // This is the address to your app's "user profile" API endpoint (expects JSON) }),

    I've never programmed in JS nodes, so I don't really know what to do, and I don't understand all the code.

    I may have to change the information as indicated. Update profile information (around line 137 of library. js). But there is no user account to use the Oauth system

    After a git clone, i can't enable the plugin so i think there is something else to change.

    if someone can help me I will document everything for the link Oauth django/nodeBB. Otherwise, I'll keep the site and forum separate.

  • 0 Votes
    3 Posts
    1k Views

    Thanks.
    Feedback : I install it and its work.

    Another question : it doesn't seem to be possible to activate subscription and notification by mail for all category (like for post) to all user. Is it possible and how ?

    Thanks in advance

  • 2 Votes
    5 Posts
    3k Views

    I apologize for such a dirty job.

  • 3 Votes
    10 Posts
    5k Views

    Here is my version of it. Check out the result on UEX start page. Feel free to use Google translate

    <style> #nyheter .date { float: right; } #nyheter img { display: block; height: auto; margin: 10px 0px; max-width: 100%; } #nyheter iframe { max-width: 100%; } </style> <table id="nyheter" class="table table-striped"></table> <script type="text/javascript"> var rss_urls = [ 'http://www.fz.se/core/rss/fznews_rss20.xml', 'http://loading.se/rss.php?type=news', 'http://www.eurogamer.se/?format=rss&type=news', 'http://www.gamereactor.se/rss/rss.php?texttype=4' ]; var news_items = []; var protocol = document.location.protocol === "file:" ? "http:" : document.location.protocol; for (var i = 0; i < rss_urls.length; i++) { var rss_url = rss_urls[i]; jQuery.ajax({ type: "GET", url: protocol+'//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(rss_url), dataType: 'json', success: function(data) { values = data.responseData.feed.entries; var list = '', count = 0; jQuery.each(values, function(index, item) { if (count >= 5) { return; } var news_item = {}; var pubDate = item.publishedDate; var date = new Date(pubDate); var month = date.getMonth < 10 ? date.getMonth() : "0" + date.getMonth(); news_item.date = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getHours(); news_item.datetime = date.getTime(); news_item.link = item.link; news_item.title = item.title; news_item.content = item.content; news_items.push(news_item); count++; }); update_table(); } }); } function update_table() { news_items.sort(function(a, b) { var keyA = new Date(a.datetime), keyB = new Date(b.datetime); // Compare the 2 dates if (keyA < keyB) return 1; if (keyA > keyB) return -1; return 0; }); var list = ""; for (var i = 0; i < news_items.length; i++) { var item = news_items[i]; list += "<tr><td><a href='" + item.link + "' target='_blank'>" + item.title + "</a><span class='date'''>" + item.date + "</span> <br/> <span>" + item.content + "</span><br/></td></tr>"; } jQuery('#nyheter').html(list); } </script>

    Sharing is caring ....