Here's the code I used for the "Tweet" module which seems to work well.. I don't get any JS errors when using this. Hope this will help someone.
I tried to create a settings page to pass the colors, etc along to the javascript, but it didn't work out well and I haven't had time to continue working on it.
First, go to http://twitter.com/goodies/widget_profile to get the configuration which you'd like. Grab the code and put this configuration code between the divs on the tweet.ascx page. I added "type="text/javascript"" to the script areas to ensure there aren't any issues; twitter code leaves these out.
Grab a copy of the widget.js file from http://widgets.twimg.com/j/2/widget.js and put it in the /js folder. If the URL to the js file is blocked in this posting, you can get the URL from the above twitter URL; click on "Finish and grab code".
Module Folder/File Structure:
DesktopModules
/TweetModule
/js/widget.js
/Tweet.ascx
/Tweet.ascx.vb
Tweet.acsx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Tweet.ascx.vb" Inherits="DesktopModules_Tweet_Tweet" %>
<div id="Tweet">
<script type="text/javascript" src="js/widget.js"></script> // keep this line, do not over-write this
<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 20,
interval: 6000,
width: 'auto',
height: 600,
theme: {
shell: {
background: '#333333',
color: '#ffcc00'
},
tweets: {
background: '#000000',
color: '#ffcc00',
links: '#993300'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('%tweeterusername%').start(); // Enter your twitter user name here
</script>
</div>
Tweet.acsx.vb
Imports DotNetNuke
Imports System.Web.UI
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Security.Permissions
Partial Class DesktopModules_Tweet_Tweet
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Private Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init
Page.ClientScript.RegisterClientScriptInclude("TweetScript", ControlPath & "js/widget.js")
End Sub
End Class