Forums | Mahara Community

Support /
Issue With Twitter Filtering


anonymous profile picture
Account deleted
Posts: 3

13 January 2012, 9:08

Hey guys,I think I've identified the issue I'm experiencing but I'm not quite sure how to resolve it.I'm attempting to add a twitter widget into a block within a page. I've tried both using a HTML page block (And created a simple HTML page with the widget on) and pasting the widget code into the HTML view of a text block, neither works.

Upon further investigation I looked at the code for the filter knowing that all HTML goes through the purifier and, it appears that the filter mightn't work. The widget code looks like this:

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 30000,
width: 'auto',
height: 300,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
behavior: 'all'
}
}).render().setUser('adamsalem').start();
</script>

Yet the filter refers to URLs that originate from twitter.com. Firstly I guess, have I identified the problem correctly and, if so, secondly, is there a fix?

Thanks in advance!

Kristina Hoeppner's profile picture
Posts: 4734

14 January 2012, 23:54

Hi Adam,

Did you have a look at Florian's Twitter plugin and see if you can find what he did to display tweets? All plugins that we know of are listed at https://wiki.mahara.org/index.php/Plugins and you are welcome to add yours there once you are done.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 3

18 January 2012, 8:29

Hi Kristina,

It's a widget from here as opposed to anything bespoke: http://twitter.com/about/resources/widgets.

I'll look at that plugin though, might do the trick, thanks.

anonymous profile picture
Account deleted
Posts: 3

18 January 2012, 9:41

Would edit my post, but it seems I can't. The plugin doesn't do quite what we're after.

Kristina Hoeppner's profile picture
Posts: 4734

20 January 2012, 22:51

Hello Adam,

In order to let any code through HTML Purifier, you will have to add a filter. If you don't want to do it in a separate block as Florian did in his plugin, you would need to add a filter to HTML Purifier in general. I can't help you with the specifics as I am not a developer. But if you look at the filters for YouTube, Slideshare, Glogster, WikiEducator etc. you might get an idea of what needs to be done.

Cheers

Kristina

5 results