This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Twitter Widget Profile Dynamically?
11-10-2012, 12:16 AM
Post: #1
Change Twitter Widget Profile Dynamically?
I'm using a standard twitter profile widget and trying to figure out a way to change the profile after the page has rendered.

The last line of the widget is as follows:

}).render().setUser(document.getElementById("USER_NAME_HERE").value).start();

Is it possible to update the USER_NAME_HERE field on the fly? For example, if I wanted a random one profile of five possible to appear on the page, I know how to select the random one, but can't figure out how to get it to update with the result.

Thanks in advance.

FYI here is the link to the create a widget page: http://twitter.com/about/resources/widge...et_profile

Ads

Find all posts by this user
Quote this message in a reply
11-10-2012, 12:25 AM
Post: #2
 
Try this code.
<div id="my_widget_region"> <script src="http:// widgets.twimg.com/j/2/ widget.js"></script> <script>do_twitter_widget('"# winning" or "justin bieber"');</ script> </div> function do_twitter_widget (search_query, title, subtitle) { if (!window.widgetRef) { window.widgetRef = new TWTR.Widget({ version: 2, type: 'search', search: search_query, interval: 6000, title: title || 'Tweets related to', subject: subtitle || search_ query, width: 'auto', height: 500, theme: { shell: { background: '#8EC1DA', color: '#FFFFFF' }, tweets: { background: '#FFFFFF', color: '#444444', links: '#1985B5' } }, features: { scrollbar: false, loop: true, live: true, hashtags: true, timestamp: true, avatars: true, behavior: 'default' }, ready: function() { // when done rendering... } }); window.widgetRef .render() .start(); } else { if (search_query != window.old_twitter_search) { window.widgetRef .stop() .setSearch(search_query) .setTitle(title || 'Tweets related to') .setCaption(subtitle || search_query) .render() .start(); } } window.old_twitter_search = search_query; return window.widgetRef; }

Ads

Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)