Jeevan Dongre
Jeevan Dongre

Reputation: 4649

Twitter search box widget

I am making calls to twitter dynamically to get the widget on the web site. http://twitter.com/about/resources/widgets/widget_search

Instead of user getting the code from the above website, I am giving a text box to enter the same details to get the twitter search widget box.

I am able to get the tweets, but its removing the previous content and which is already on the page and updating the same page with only twitter feeds. Here is the code:

<label>Enter Search Keyword:</label>
<input type="text" id="twtKeyword"/>
<br/><br/>

<label>Enter Title:</label>
<input type="text" id="twtTitle"/>
<br/><br/>

<label>Enter Subject:</label>
<input type="text" id="twtSubject"/>
<br/><br/>

<input type="button" id="twtBtnClick" value="Click" onclick="getPageTwitter();"></input>









function getPageTwitter()
{
    var searchWord=document.getElementById("twtKeyword").value;
    var titleTwt=document.getElementById("twtTitle").value;
    var subjectTwt=document.getElementById("twtSubject").value;

    $( "#twitterWidget" ).dialog( "close" );


  new TWTR.Widget({
  version: 2,
  type: 'search',
  search: searchWord,
  interval: 6000,
  title: titleTwt,
  subject: subjectTwt,
  width: 250,
  height: 300,
  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,
    toptweets: true,
    behavior: 'default'
  }
}).render().start();


}

But I want the widget to stay in the same page without effecting the previous content of the page

Upvotes: 0

Views: 878

Answers (2)

Nalcro
Nalcro

Reputation: 11

I think i've the answer for you. I got some coding done to do exactly what you want, Maybe you could iframe a page i'd be willing to setup? up to you.

you can view the page here http://www.twitamix.com

Upvotes: 1

abraham
abraham

Reputation: 47893

This isn't something the Search Widget was designed for. You will likely have to write your own JavaScript to poll the Search API and render the results with your own code.

Upvotes: 1

Related Questions