Hour 10. Building a Simple Twitter Client, Part II

What You’ll Learn in This Hour:

How to send a message to Twitter

How to send a direct versus a normal tweet

How to sanitize messages

Updating and Adding New Files to Support Input Text Field

Now that we have a simple Twitter client to read messages, we need to work on making our client application send messages. The good news is that we can still use our current framework with a few additional files. In addition, we will introduce a few JavaScript calls to support user interaction.

First, we need to add to our index.php file to allow a user to type in a message.

Edit index.php

Open the file index.php, and after this line:

<title>twitterAPI 24</title>

Add the following line:

<script type='text/javascript' ...

Get Sams Teach Yourself the Twitter API in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.