0

Is there a way to fetch my latest tweet in plain-text form using javascript?
I was going to use fsockopen(), but my host does not have that enabled.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by dolphinaura
0

Dolphin,

The twitter API provides for this.

Try the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Airshow :: Untitled</title>
<style type="text/css">
body {
	background-color: #e0e0e0;
}
/* ul container */
#twitter_update_list {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

/* a single line entry */
#twitter_update_list li {
	margin-bottom: 2px;
	padding: 3px 10px;
	background-color: #99ccff;
	border-width: 1px;
	border-style: solid;
	border-top-color: #cceeff;
	border-left-color: #cceeff;
	border-right-color: #003366;
	border-bottom-color: #003366;
}

/* the tweet itself */
#twitter_update_list li span {
	color: #003366;
	font-size: 10px;
	font-family: verdana;
	letter-spacing: 0.1em;
}

/* the tweet link */
/* by default it has font-size:85% */
#twitter_update_list li a {
	font-size: 9px;
	letter-spacing: 0;
}
</style>

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>

</head>

<body>

<h1>My Latest Tweets</h1>
<ul id="twitter_update_list">
<li>Loading Tweets ...</li>
</ul>

<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/yourTwitterUserName.json?callback=twitterCallback2&count=5"></script>
<!-- Change count value for the number of tweets you require. -->

</body>
</html>

Airshow

0

Dolphin,

The twitter API provides for this.

Try the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Airshow :: Untitled</title>
<style type="text/css">
body {
	background-color: #e0e0e0;
}
/* ul container */
#twitter_update_list {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

/* a single line entry */
#twitter_update_list li {
	margin-bottom: 2px;
	padding: 3px 10px;
	background-color: #99ccff;
	border-width: 1px;
	border-style: solid;
	border-top-color: #cceeff;
	border-left-color: #cceeff;
	border-right-color: #003366;
	border-bottom-color: #003366;
}

/* the tweet itself */
#twitter_update_list li span {
	color: #003366;
	font-size: 10px;
	font-family: verdana;
	letter-spacing: 0.1em;
}

/* the tweet link */
/* by default it has font-size:85% */
#twitter_update_list li a {
	font-size: 9px;
	letter-spacing: 0;
}
</style>

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>

</head>

<body>

<h1>My Latest Tweets</h1>
<ul id="twitter_update_list">
<li>Loading Tweets ...</li>
</ul>

<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/yourTwitterUserName.json?callback=twitterCallback2&count=5"></script>
<!-- Change count value for the number of tweets you require. -->

</body>
</html>

Airshow

ah!
thanks!
works perfectly!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.