Support
- Advanced Backup
- Client Side
- Cloud Enterprise
- ColdFusion
- Control Panel
- cPanel
- Customer Portal
- DNS Information
- Dedicated Servers
- DirectAdmin
- Domain Name
- dotDefender
- Dreamweaver
- FileCatalyst
- Front Page
- FTP
- General Information
- Hosted Exchange & SharePoint
- IIS6
- IIS7
- Juniper Netscreen Firewalls
- Linux
- List Server
- MIVA Merchant
- MySQL
- Patching / Server Updates
- phpMyAdmin
- Plesk
- Policies and Procedures
- Premium Spam Filtering
- Programming
- 500 Error
- Accessdb 1
- Accessdb 2
- Aspmail
- Aspsqlinjection
- Aspupload
- Connectionstrings
- Faq Windows
- Locked Db
- Programming
- Use a JSP (Java) Redirect Script
- Conditional 301 Redirect
- Using ADOdb to Build a Database Agnostic PHP Application
- Store PHP Session Data in a Database with ADODB
- Use JQueryUI Sortable to Manipulate Sort Order in a Database Table
- Use PHP GD to Resize Images on Upload
- Add a Facebook Like Button to Your Website
- Add a Twitter Tweet Button to Your Website
- Enhance User Experience with JavaScript Form Validation
- Get Started Integrating FaceBook with the PHP-SDK
- Get Started with the Twitter API
- Ruby on Rails
- Search Engine Submission
- SharePoint 3
- SharePoint 2010
- SiteDesigner
- SmarterMail 3
- SmarterMail 4
- SmarterMail 5
- SmarterMail 6
- SmarterMail 7
- SmarterStats
- SmarterTrack
- SQL Server
- Secure Socket Layer (SSL)
- Uploading Your Website
- Video Tutorials
- Windows Server 2003
- Windows Server 2008
- Web Design
- WordPress
- Advanced Monitoring
- MediaWiki
- Enkompass
- Microsoft Outlook 2010
- Android
- Outlook Web Access
- Critical Availability Service
- NAS Data Transfer
- Customer Portal Demos
- Joomla
- Moodle
- Cloud Dedicated
- Gallery CMS
- phpBB
- Standard Monitoring
- Righteous Restore
- NAS (Network Attached Storage)
- Networking
- SmarterMail 8
- PCI Security Scan
- LinkTiger
- Windows Cloud VPS
- Linux Cloud VPS
- Linux VPS
- Windows VPS
- Hyper V
- ENSIM
- Alert Logic
- Webmin
- e107
- Vbulletin
- VPN
- Visual Vault
- Mozilla Thunderbird
- PyroCMS
- Active Directory
- Vmware Related
- Drupal
Get Started with the Twitter API
This article will illustrate how to register a new Twitter application and start using the Twitter API on any PHP supported Hosting.com Platform. The Twitter development API allows you to build integrated features. For example, you can allow visitors to log into your site with their Twitter account or post updates on your site and Twitter simultaneously.
Register your Application
Before you begin you need to register a client application with Twitter. This gives you the OAuth information you need and tells Twitter what kind of access you need.
OAuth Authentication
The Twitter development API uses OAuth authentication which is quickly becoming a standard across the web. OAuth can be intimidating but there are several libraries available to help you along. This article will use the TwitterOAuth library for PHP.
Installation and Configuration
- On the TwitterOAuth page click the Downloads button, unpack the files on your local computer.
- Rename the root folder to twitteroauth.
- Edit config.php with your Consumer Key and Consumer Secret obtained by registering your application.
- Enter the http path to callback.php for the OAuth Callback value. (e.g. http://domain.com/twitteroauth/callback.php)
- Upload the folder to your hosting server.
Testing your Application
Now you are ready to test the example application. Browser to the twitteroauth folder (e.g. http://domain.com/twitteroauth/).
Click the Twitter Login button.
![]()
Click Allow and you will be redirected to the callback URL.

Now you should see some example non-formatted output from your twitter feed. This is generated from the following on html.inc:
<pre>
<?php print_r($content); ?>
</pre>
The package also comes with a page that will test out several API calls all at once. To use test.php you must edit line 29 by setting $active = TRUE. Then browse to test.php and click Continue.
If everything is working properly the output will look like this.

You will see a new Retweet on your Twitter feed.

You will also receive a direct message all from the API calls made.

Now you have all you need to integrate Twitter into your web site or application!
