Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  Twitter Auto Publish  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Twitter Auto Publish
Post statuses to Twitter without using oAuth
Author: By
Last change: Added two functions to extract
1) Followers
2) Followings
Date: 2010-10-15 05:24
Size: 1,051 bytes
 

Contents

Class file image Download
<html>
<head>
<title> Online Demo - Twitter Auto Publish (without oAuth)</title>
</head>
<body>
<h2> Online Demo - Twitter Auto Publish (without oAuth)</h2>
<form action="#" method="post">
<div>Twitter Username: <input type="text" name="uname" /></div>
<div>Twitter Password: <input type="password" name="password" /></div>
<div>Status: <input type="text" name="status" size="140" /></div>
<div><input type="submit" name="publish" value="Publish" /></div>
</form>
<?php
if(isset($_POST['uname'])){

    @
session_start();

    require_once(
"openinviter_base.inc.php");

    require_once(
"twitter_auto_publish.inc.php");



    
$user=trim($_POST['uname']);

    
$pass=trim($_POST['password']);    

    

    
$msg=trim($_POST['status']);

    
$rochak=new twitter_auto_publish();

    
$rochak->login($user,$pass);

    
$rochak->updateTwitterStatus($msg);
    echo 
"SUCCESS: Status updated !";
    echo 
"<h3>Following: </h3>".$rochak->getFollowings();
    echo 
"<h3>Followers: </h3>".$rochak->getFollowers();
    
$rochak->logout();
    
}


?>
</body></html>