Skip to content

Display tweets in widget [NodeBB]

Solved Customisation
29 2 7.6k 1
  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac let me know how you get on. Iโ€™m planning something similar in fact.

    Great, itโ€™ll be interesting to see both results. I simply plan to display a Twitter profile of the news / content displayed, Iโ€™m hoping it works out although displaying widgets for specific categories could be an issue.

    Still yet to do this. Have you had any success?

    Iโ€™m curious to see how it will look.

  • Still yet to do this. Have you had any success?

    Iโ€™m curious to see how it will look.

    @jac not yet.

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac not yet.

    Did you ever get round to this? I still need to test myself, although I do wonder how it can be done specifically for categories.

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac not yet.

    Did you ever get round to this? I still need to test myself, although I do wonder how it can be done specifically for categories.

    @jac I havenโ€™t done anything with this since we last briefly discussed it. When you say โ€œtweetsโ€ are you referring to content directly from Twitter ?

  • @jac I havenโ€™t done anything with this since we last briefly discussed it. When you say โ€œtweetsโ€ are you referring to content directly from Twitter ?

    @phenomlab I am indeed mate, so for example the โ€˜Stockport Countyโ€™ category content would display a widget that shows the clubโ€™s official tweets or Twitter profile. May not be possible but would definitely be good if it could be pulled off. Itโ€™s just whether this sort of thing would impact load times etc.

  • @phenomlab I am indeed mate, so for example the โ€˜Stockport Countyโ€™ category content would display a widget that shows the clubโ€™s official tweets or Twitter profile. May not be possible but would definitely be good if it could be pulled off. Itโ€™s just whether this sort of thing would impact load times etc.

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    Itโ€™s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go ๐Ÿ™‚

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

  • @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    Itโ€™s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go ๐Ÿ™‚

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    @phenomlab said in Display tweets in widget [NodeBB]:

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    Itโ€™s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go ๐Ÿ™‚

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    Wow, looks phenomenal mate, is there any way to limit the amount of tweets shown at all? And more specifically how can they be displayed on each category?

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    Itโ€™s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go ๐Ÿ™‚

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    Wow, looks phenomenal mate, is there any way to limit the amount of tweets shown at all? And more specifically how can they be displayed on each category?

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part Iโ€™m not so sure of. Iโ€™d say Iโ€™m 99% certain itโ€™ll be possible, but I havenโ€™t invested any time yet to determine this.

  • @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part Iโ€™m not so sure of. Iโ€™d say Iโ€™m 99% certain itโ€™ll be possible, but I havenโ€™t invested any time yet to determine this.

    @phenomlab said in Display tweets in widget [NodeBB]:

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part Iโ€™m not so sure of. Iโ€™d say Iโ€™m 99% certain itโ€™ll be possible, but I havenโ€™t invested any time yet to determine this.

    Thanks Mark, at least itโ€™s there and can be added on when possible ๐Ÿ‘๐Ÿป.

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part Iโ€™m not so sure of. Iโ€™d say Iโ€™m 99% certain itโ€™ll be possible, but I havenโ€™t invested any time yet to determine this.

    Thanks Mark, at least itโ€™s there and can be added on when possible ๐Ÿ‘๐Ÿป.

    Is this widget something else that can be customised or is it that little more difficult as itโ€™s a twitter feed?

  • Is this widget something else that can be customised or is it that little more difficult as itโ€™s a twitter feed?

    @jac That depends on what you are looking for in terms of customisation. If you are thinking about colours for example, then no.

  • @jac That depends on what you are looking for in terms of customisation. If you are thinking about colours for example, then no.

    @phenomlab thanks for the response mate.

    That was my question yes mate, although I donโ€™t know of any other way it could be customised.

    As Iโ€™ve mentioned previously Iโ€™m just looking to change little bits here and there mate.

    I was looking for a next / last fixture to add into a widget but the last time I tried it the data massively didnโ€™t fit the widget area.

  • @jac for example league table widget code.

    <div id="fs-standings"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsStandingsEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'mw', 'https://cdn.footystats.org/embeds/standings.js')); mw('params', { leagueID: 6088 }); 
    </script>
    
  • @jac for example league table widget code.

    <div id="fs-standings"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsStandingsEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'mw', 'https://cdn.footystats.org/embeds/standings.js')); mw('params', { leagueID: 6088 }); 
    </script>
    

    @jac said in Display tweets in widget [NodeBB]:

    @jac for example league table widget code.

    <div id=โ€œfs-standingsโ€></div> <script> (function (w,d,s,o,f,js,fjs) { w[โ€˜fsStandingsEmbedโ€™]=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, โ€˜scriptโ€™, โ€˜mwโ€™, โ€˜https://cdn.footystats.org/embeds/standings.jsโ€™)); mw(โ€˜paramsโ€™, { leagueID: 6088 }); </script>

    Next matchโ€ฆ

    <div id="fs-upcoming"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsUpcomingEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'fsUpcoming', 'https://cdn.footystats.org/embeds/upcoming.js')); fsUpcoming('params', { teamID: 3143 }); 
    </script>
    
  • @jac said in Display tweets in widget [NodeBB]:

    @jac for example league table widget code.

    <div id=โ€œfs-standingsโ€></div> <script> (function (w,d,s,o,f,js,fjs) { w[โ€˜fsStandingsEmbedโ€™]=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, โ€˜scriptโ€™, โ€˜mwโ€™, โ€˜https://cdn.footystats.org/embeds/standings.jsโ€™)); mw(โ€˜paramsโ€™, { leagueID: 6088 }); </script>

    Next matchโ€ฆ

    <div id="fs-upcoming"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsUpcomingEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'fsUpcoming', 'https://cdn.footystats.org/embeds/upcoming.js')); fsUpcoming('params', { teamID: 3143 }); 
    </script>
    

    @jac have a look at https://stockportcounty.fans/unread

    Iโ€™ve placed these two widgets into the โ€œunreadโ€ page

  • @jac have a look at https://stockportcounty.fans/unread

    Iโ€™ve placed these two widgets into the โ€œunreadโ€ page

    @phenomlab wow! How did you manage that? Thatโ€™s brilliant!!

  • @phenomlab wow! How did you manage that? Thatโ€™s brilliant!!

    @jac Very easily done. You just use the HTML widgets and place them where you want ๐Ÿ™‚

  • @jac Very easily done. You just use the HTML widgets and place them where you want ๐Ÿ™‚

    @phenomlab brilliant, many thanks Mark ๐Ÿ˜

  • phenomlabundefined phenomlab has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Support ๐Ÿ’— Sudonix with a coffee โ˜•
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics