Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?

Twitter Extension
Vendor
MindTouch
Type Script
Categories Communication
Requires MindTouch Deki 1.9.0b or later
Status Stable
License Free/Open Source
Manifest http://scripts.mindtouch.com/twitter.xml

 

Table of Contents

Description

This extension contains functions for embedding Twitter feeds.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Functions

twitter.all(name, width, height, theme) : xml

Embed Twitter feed of user and friends.

Parameters:

NameTypeDescription
namestrTwitter user name.
widthnum(optional) Control width. (default: 290)
heightnum(optional) Control height. (default: 350)
themestr(optional) Control theme. (one of "smooth", "velvetica", "revo"; default: "smooth")


twitter.counter(name) : xml

Show Twitter counter for user.

Parameters:

NameTypeDescription
namestrTwitter user name.


twitter.current(name, width, height, backgroundcolor) : xml

Show latest Twitter entry from user.

Parameters:

NameTypeDescription
namestrTwitter user name.
widthnum(optional) Control width. (default: 176)
heightnum(optional) Control height. (default: 176)
backgroundcolorstr(optional) Background color. (default: "0x111B1C")


Script Source

<extension>
  <title>Twitter Extension</title>
  <label>Twitter</label>
  <copyright>Copyright (c) 2006-2009 MindTouch, Inc.</copyright>
  <description>This extension contains functions for embedding Twitter feeds.</description>
  <uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Twitter</uri.help>
  <uri.logo>http://scripts.mindtouch.com/logos/twitter-logo.png</uri.logo>
  <namespace>twitter</namespace>

  <requires host="MindTouch Deki 1.9.0b" />
  
  <function>
    <name>all</name>
    <description>Embed Twitter feed of user and friends.</description>
    <param name="name" type="str">Twitter user name.</param>
    <param name="width" type="num" optional="true">Control width. (default: 290)</param>
    <param name="height" type="num" optional="true">Control height. (default: 350)</param>
    <param name="theme" type="str" optional="true">Control theme. (one of "smooth", "velvetica", "revo"; default: "smooth")</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <object 
            classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" 
            eval:width="args.width ?? 290" 
            eval:height="args.height ?? 350" 
            id="TwitterWidget" 
            align="middle"
          >
            <param name="allowScriptAccess" value="always" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#000000" />
            <param name="FlashVars" eval:value="'userID=' .. string.trim(args.name) .. '&amp;styleURL=http://static.twitter.com/flash/widgets/profile/' .. string.trim(args.theme ?? 'smooth') .. '.xml'" />
            <embed 
                src="http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf" 
                quality="high" 
                bgcolor="#000000" 
                eval:width="args.width ?? 290" 
                eval:height="args.height ?? 350" 
                name="TwitterWidget" 
                align="middle" 
                allowScriptAccess="sameDomain" 
                allowFullScreen="false" 
                type="application/x-shockwave-flash" 
                pluginspage="http://www.macromedia.com/go/getflashplayer" 
                eval:FlashVars="'userID=' .. string.trim(args.name) .. '&amp;styleURL=http://static.twitter.com/flash/widgets/profile/' .. string.trim(args.theme ?? 'smooth') .. '.xml'"/>
          </object>
        </body>
      </html>
    </return>
  </function>

  <function>
    <name>current</name>
    <description>Show latest Twitter entry from user.</description>
    <param name="name" type="str">Twitter user name.</param>
    <param name="width" type="num" optional="true">Control width. (default: 176)</param>
    <param name="height" type="num" optional="true">Control height. (default: 176)</param>
    <param name="backgroundcolor" type="str" optional="true">Background color. (default: "0x111B1C")</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <embed src="http://twitter.com/flash/twitter_badge.swf"
                 eval:flashvars="'id=' .. string.trim(args.name) .. '&amp;type=user&amp;color1=' .. (args.backgroundcolor ?? '0x111B1C')"
                 quality="high"
                 eval:width="web.size(args.width ?? 176)"
                 eval:height="web.size(args.height ?? 176)"
                 name="twitter_badge"
                 align="middle"
                 allowScriptAccess="always"
                 wmode="transparent"
                 type="application/x-shockwave-flash"
                 pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </body>
      </html>
    </return>
  </function>

  <function>
    <name>counter</name>
    <description>Show Twitter counter for user.</description>
    <param name="name" type="str">Twitter user name.</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <a rel="custom" eval:href="uri.appendquery('http://twittercounter.com', { username: args.name })" eval:title="'TwitterCounter for @' .. args.name">
            <img width="88" height="26" eval:src="uri.appendquery('http://twittercounter.com/counter', { username: args.name })" style="border: medium none ;" eval:alt="'TwitterCounter for @' .. args.name" />
          </a>
        </body>
      </html>
    </return>
  </function>
</extension>

 

Tag page
Viewing 3 of 3 comments: view all
The "Current" width & height are locked into being proportional to the lowest setting of either one. It is box, no matter what.
Posted 07:00, 17 Dec 2008
I'm at a conference that has a twitter hash tag. How can I build a mashup of my conference notes along with the tweets for a specified hash tag for a given start date timestamp and end timestamp (to coincide with a specific presentatino)?
Posted 21:59, 3 Jun 2009
@guyknur the extension doesn't support twitter search, but I put together a simple example in my sandbox how to query twitter directly and show results for it in a wiki page. see http://developer.mindtouch.com/User:SteveB/Sandbox/Twitter_Search
Posted 23:59, 3 Jun 2009
Viewing 3 of 3 comments: view all
You must login to post a comment.