github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

bluescripts / iptweet

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: cf5db14

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Implementations in different languages to post to Twitter your IP (for use with a home server?) — Read more

  cancel

http://bluescripts.net/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

php 
bluescripts (author)
Tue Jan 27 13:57:53 -0800 2009
commit  cf5db14eb430c57a8ff99ad6c0614ec47f54686d
tree    563567f1bcf40a3c51db9750337215124cd15297
parent  243f7797e9bd07c951ed35f0bfd0607ee37df90a
iptweet / php / iptweet.php php/iptweet.php
100755 28 lines (22 sloc) 1.027 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env php
<?php
$f = file("http://bb.bluescripts.net/ip.php");
$ip = $f[0];
 
                       $post_data['status'] = $ip;
                       $url = "http://twitter.com/statuses/update.xml";
                       $o="";
                       foreach ($post_data as $k=>$v)
                       {
                           $o.= "$k=".utf8_encode($v)."&";
                       }
                       $post_data=substr($o,0,-1);
                      
                       $ch = curl_init();
                       curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                       curl_setopt($ch, CURLOPT_USERPWD, 'USERNAME:PASSWORD');
                       curl_setopt($ch, CURLOPT_POST, 1);
                       curl_setopt($ch, CURLOPT_HEADER, 0);
                       curl_setopt($ch, CURLOPT_URL, $url);
                       curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
                       $result = curl_exec($ch);
//echo $result;
 
 
 
?>
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server