Adding a Twitter feed block to your Moodle module
June 19th, 2013 at 10:06
Twitter has recently turned off their API for RSS. What this means is that if you’ve created a block in your Moodle module that display tweets, they will no longer work. The current alternative is to use Twitter’s own widget.
The disadvantage is that it adds to the loading time of the page, and it is not as easily customisable so takes up a lot more space in your column. Also it is a shame that Twitter have turned their backs on the universal standard of RSS feeds while other services still use them.
How to add a Twitter widget to Moodle
- Log in to Twitter
- Click on the settings icon (the cog wheel next to the search box)
- Select ‘Settings’
- Select ‘Widgets’ from the left hand menu
- The first time, use ‘Create New’ to create a widget.�
Once you have a widget, you can edit it in the same way, using the ‘edit’ button
- Choose the timeline source.�
Usually this will be ‘User Timeline’ but it may be a search term (e.g., your course hashtag, such as #nooc13)
- Select options.�
Usually you will want pictures expanded. You can also include or exclude replies.
- Set the height.�
600 is the default, but still only shows around 3 tweets while taking up a large portion of your column. 350px may be a better bet – a scroll bar will be presented for the user.
- Leave the ‘Theme’ as ‘light’.
- Click ‘Create Widget’
- In the code box which then appears, select all the text, and copy it (using CTRL-C on your keyboard)
- Open a text editor (such as Notepad in Windows) and paste the text into there
Step 2 – Moodle
- Log in to Moodle (you will need to be an editor or Editing teacher)
- Go to your module
- Click ‘Turn editing on’ at top right
- Scroll down to the bottom of the right-hand column to ‘Add a block’
- Select the drop down menu and choose the block: ‘HTML’
- Wait for the screen to refresh and then scroll down to the bottom of the right-hand column again, where you will see (new HTML block)
- Click on the Edit/configure icon for that block
- Give it a title (e.g., My tweetstream)
- In the Content box click the HTML button (to the right of the bottom row of editing icons)
- Paste in the code text you saved above
- Click ‘Update’
You will not normally need to change any other settings
- Click ‘Save changes’
Return to the home screen where you will see your tweets appear.
Now that you have a twitter widget defined, you can edit it in futur by logging back into Twitter, and going to settings->widgets to get to your list of widgets. Click the ‘edit’ button to edit it. There is no need to change the Moodle side of things because the widget will update to reflect your changes. However the changes may take a few minutes to work their way through to your Moodle page.