Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e44fe3b
Showing
6 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name" : "Twitter", | ||
"sms_name" : "Twitter", | ||
"voice_title" : "Latest Tweet", | ||
"sms_title" : "Latest Tweet", | ||
"description" : "Returns the latest tweet from the specified user.", | ||
"type" : ["sms", "voice"] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
$name = AppletInstance::getValue('name'); | ||
|
||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL, 'http://api.twitter.com/1/users/show.json?screen_name=' . $name); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | ||
$tweet = json_decode(curl_exec($ch)); | ||
curl_close($ch); | ||
|
||
$response = new Response(); | ||
|
||
if(AppletInstance::getFlowType() == 'voice'){ | ||
$response->addSay($tweet->status->text); | ||
$next = AppletInstance::getDropZoneUrl('next'); | ||
if(!empty($next)) | ||
$response->addRedirect($next); | ||
} | ||
else | ||
$response->addSms($tweet->status->text); | ||
|
||
$response->Respond(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="vbx-applet"> | ||
<div class="vbx-full-pane"> | ||
<h3>Twitter username</h3> | ||
<p>Must not be a protected account.</p> | ||
<fieldset class="vbx-input-container"> | ||
<input type="text" name="name" class="medium" value="<?php echo AppletInstance::getValue('name','chadsmith'); ?>" /> | ||
</fieldset> | ||
</div> | ||
<?php if(AppletInstance::getFlowType() == 'voice'): ?> | ||
<h2>Next</h2> | ||
<p>After this applet is tracked, continue to the next applet</p> | ||
<div class="vbx-full-pane"> | ||
<?php echo AppletUI::DropZone('next'); ?> | ||
</div><!-- .vbx-full-pane --> | ||
<?php endif; ?> | ||
</div><!-- .vbx-applet --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name" : "Twitter", | ||
"author" : "Chad Smith <chad@nospam.me>", | ||
"description" : "Returns the latest tweet from the specified user.", | ||
"url" : "http://twitter.com/chadsmith" | ||
} |