Results 1 to 7 of 7
  1.    #1  
    Fair warning - there may be a more secure way to do this, but I'm not overly concerned about the terribly minuscule chance of someone figuring out how to post a fake tweet to my account. YMMV.

    Your server will need to have PHP and Curl installed at the very least.

    I used the instructions here
    Search results - WebOS Internals

    to add a few new items to global search, including Amazon, Twitter search, Gmail, and posting directly to twitter using the PHP API. What I did was create a php script on my web server that looks like this:
    Code:
    <?php
    $uname = 'YOUR TWITTER USERNAME';//example "blah" for twitter.com/blah, or your email address
    $pwd = 'YOUR PASSWORD HERE';
    
    $twitter_url = 'http://twitter.com/statuses/update.xml';
    $curl_handle = curl_init();
    curl_setopt($curl_handle,CURLOPT_URL,"$twitter_url");
    curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
    curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($curl_handle,CURLOPT_POST,1);
    curl_setopt($curl_handle,CURLOPT_POSTFIELDS,"status=" . $_GET['status']);
    curl_setopt($curl_handle,CURLOPT_USERPWD,"$uname:$pwd");
    $buffer = curl_exec($curl_handle);
    curl_close($curl_handle);
    if (empty($buffer)){echo '<br/>message';}else{echo '<br/>success';}
    ?>
    Save the file on your server as something like post-to-twitter.php, then follow the instructions at

    Search results - WebOS Internals

    to add the necessary new global search option and graphic. For the url that would normally be a search string, use

    Code:
    http://www.yourserver.com/post-to-twitter.php?status=
    Now, from anywhere you can get to global search, just start typing your tweet. Choose your new search option when you're done typing it out and voila!

    Thoughts?
  2. #2  
    uhm thanks good source
    Last edited by nirvanahue; 03/13/2011 at 11:17 AM.
  3. pomokey's Avatar
    Posts
    526 Posts
    Global Posts
    540 Global Posts
    #3  
    Since you are doing this for yourself, you can easily secure it by simply adding a password to the url:

    Code:
    http://www.yourserver.com/post-to-twitter.php?password=APPLESAUCE&status
    then in your php,

    Code:
    <?php
    if ( $_GET['password'] == "APPLESAUCE" ) {
        //do twitter stuff here
    };
    ?>
    neathings - neatˇthings and apps for webOS
  4. #4  
    This is made much easier using Just Type, but for the 1.4.5 customers it's ok.
  5. #5  
    Quote Originally Posted by rsanchez1 View Post
    This is made much easier using Just Type, but for the 1.4.5 customers it's ok.
    correct me if i'm wrong, but the difference is that with dirtygreek's solution the twitter status gets updated 'directly' from within universal search (the php does all the work), whereas just type/quick action just launches the twitter app from which you can update your twitter status, right?
  6. pomokey's Avatar
    Posts
    526 Posts
    Global Posts
    540 Global Posts
    #6  
    Quote Originally Posted by johnnygewitter View Post
    correct me if i'm wrong, but the difference is that with dirtygreek's solution the twitter status gets updated 'directly' from within universal search (the php does all the work), whereas just type/quick action just launches the twitter app from which you can update your twitter status, right?
    The new quick actions let you program what happens with the text you type into just type. So someone could theoretically make an app that just posts whatever you type as your twitter status.
    neathings - neatˇthings and apps for webOS
  7. giggles's Avatar
    Posts
    677 Posts
    Global Posts
    690 Global Posts
    #7  
    wow thankyou

Tags for this Thread

Posting Permissions