I'm playing with the twitter api and I'm trying to add a particle box for posting to twitter.
In the php code section for a particle box, is the following code valid? Can we include files from the particle?
Code:
include_once('twitter.php');
if (!empty($session->uid)) {
$curTwitter = new twitter("username", "password");
if (isset($_POST['submit'])) {
$twitter_status = $_POST['twitter_stat'];
if (strlen($twitter_status) > 0) {
if( $curTwitter->setStatus($twitter_status) == true)
echo "<p>Updated Succesfully</p>";
else
echo "<p>Sorry but Twitter is unavailable at this time</p>";
} else
echo "<p>Error: We won't send blank messages!</p>";
}
}
here's my form code....basic stuff really.
Code:
<h2>Tell Twitter</h2>
<p><strong>What are you doing?</strong></p>
<form action=" echo $_SERVER['PHP_SELF']; " method="post">
<input name="twitter_stat" type="text" id="twitter_stat" size="40" maxlength="140" />
<input type="submit" name="submit" id="submit" value="Send"/>
</form>