• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Twitter stream or tweets widget

Scheduled Pinned Locked Moved NodeBB Plugins
6 Posts 4 Posters 2.3k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    wrote on last edited by
    #1

    I want to create a widget that displays either a twitter stream based on search terms or display tweets from specified twitter handles.

    It would probably be a process on the server that emits the tweets to widget clients. I am comfortable with javascript but I am relatively new to Node.js. Could someone please guide me on the best way to implement this?

    @julianlam @psychobunny @baris?

    A 1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    replied to pichalite on last edited by
    #2

    @pichalite ACP > Widgets > Add New HTML Widget into Home Sidebar or somewhere similar. Put the code that shows the twitter widget into the widget you just created, give it class from the right side menu and click save.

    1 Reply Last reply
    0
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    wrote on last edited by
    #3

    Thanks @a_5mith. Not sure why I was thinking that I need to create a NodeBB plugin for this.

    1 Reply Last reply
    0
  • 3malG3 Offline
    3malG3 Offline
    3malG
    wrote on last edited by
    #4

    If I do so, then the twitter widget is not regenerated (say the javascript is not running) if i change to "Recent" and the back to Main page. I have the twitter widget on homepage sidebar with this code:

    <a class="twitter-timeline"  href="https://twitter.com/3malG" data-widget-id="507843649955041282">Tweets von @3malG </a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    

    The Function seems not to run if I change the page on the nodebb topbar. Do I need to bind this code to some event, or what is required?

    I use the current development edition for nodebb directly from github.

    1 Reply Last reply
    1
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #5

    Try this

    <a class="twitter-timeline"  href="https://twitter.com/3malG" data-widget-id="507843649955041282">Tweets von @3malG </a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <script>
     if(window.twttr !== undefined) {
          window.twttr.widgets.load($('.motd')[0]);
     }
    </script>
    
    3malG3 1 Reply Last reply
    1
  • 3malG3 Offline
    3malG3 Offline
    3malG
    replied to <baris> on last edited by
    #6

    @baris said:

    Try this

    <a class="twitter-timeline"  href="https://twitter.com/3malG" data-widget-id="507843649955041282">Tweets von @3malG </a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <script>
     if(window.twttr !== undefined) {
          window.twttr.widgets.load($('.motd')[0]);
     }
    </script>
    

    Yes, now it works! Thank you very much!

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development