Jump to content

TechCentric-Nick

Active Members
  • Posts

    6
  • Joined

  • Last visited

Contact Methods

  • AIM
    TCentric+Nick
  • Website URL
    http://www.techcentric.org
  • ICQ
    0

Profile Information

  • Location
    Somewhere YOU aren't...

Recent Profile Visitors

774 profile views

TechCentric-Nick's Achievements

Newbie

Newbie (1/14)

  1. It looks like we're working on something very similar here, at least as far as trying to grab results from Summize/Twitter and do stuff with them. I spent a bit of time last week to work on a script (also using Magpie) to essentially mimic the currently disabled Track feature on Twitter with a Summize RSS feed by parsing the results and SMSing them to me through teleflip. And of course, I'm willing to share with the community, so here's what I've got: <?php /* * TwitterTrack * A useless hack for supplementing Twitter's tracking until its fixed * * Nick Tabick - nicktabick@gmail.com */ // Start by importing MagpieRSS require_once('./rss_fetch.inc'); require_once('./rss_utils.inc'); // Get the last run time from disk (in epoch) // I used intval() here because PHP seemed to assume the value was a string otherwise. $lastrun = intval(file_get_contents('./lastrun.txt')); // Define the RSS Url for Summize/Twitter Search we're using, and get it. $rss = fetch_rss('http://search.twitter.com/search.atom?q=%40nicktabick+OR+techcentric'); // Iterate through each item returned in the feed foreach ($rss->items as $item) { // Convert the time to a usable standard (epoch) $published = parse_w3cdtf($item['published']); // If the epoch time is greater than our last run... if ( $published >= $lastrun ) { // ...get all the fun stuff out of the feed and e-mail it to Teleflip for SMS mail('nonono@youcanthavethis', 'Tweet', ' ' . preg_replace('/\s\((\w+)\)/', '', $item['author_name']) . ': ' . $item['title'] . ' (' . date('m/d/y H:i',$published) . ')', "From: useyourown@ccount"); } } // Dump the current time (in epoch) so we can use it as a base value for next run. // The + 300 is to help sync the difference in clocks. This can be edited as necessary. file_put_contents('./lastrun.txt',(date('U') + 300)); ?> The time difference math is, like the comment says, to help with differences in timestamps and avoid duplicates if your clocks are off. However, I just came to the realization that while this works, perhaps a more effective option would be to store the last timestamp from the feed. This script should be friendly to any difference in time zones, as the timestamps are based upon GMT anyway. (I say 'epoch time' in my comments; by 'epoch time', I mean the number of seconds since the Unix epoch.) My script uses e-mail to send SMS notifications to my phone via Teleflip, but it would be easily adapted with the appropriate system() command from your source, Darren. Feel free to improve this script as necessary, or do whatever with it. Credit would be lovely, but considering there's always someone who's going to rip off work, I really don't care. This didn't take that long to write, anyway. Happy hacking! EDIT: I forgot to mention, but I also made a small edit to rss_utils.inc (one of the Magpie files) that may or may not be necessary. If the script doesn't work at first, try changing this line in rss_utils (should be line 28): $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; to $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z)?/"; If it isn't noticeable already, this is the regular expression used to parse the time in the RSS feed.
  2. http://picasaweb.google.com/NickTabick/Screenshots330 All my in-use boxes, including the headless VNC stuff, as of the beginning of the month/end of last month. Yeah, I realize it's a pain to have to click a link, but it keeps the thread tidier and saves the low-bandwidth people from my 7 images... ;) And kickarse...that is one of the wierdest/coolest avatars I've ever seen.
  3. Haha, no KVM switch there at all. Remotely controlling the other PCs is done via VNC, SSH, Abel (yes, despite being labeled a hacktool, it is an excellent management/administration app when paired with Cain), or a custom solution I'm not releasing at the moment. However, there are some spare keyboards and mice hidden behind the tower of PCs to the right of my desk.Yes, there is a chair...but I pulled it out so that you could see the mess of cables and other machines under the desk. Otherwise, how do you get to appreciate the mess that is 4 power strips attached to one outlet? Oh, and yeah, there is an update to that album. http://picasaweb.google.com/NickTabick/Des...eRollingUpdates
  4. http://picasaweb.google.com/NickTabick/Des...549958247773618 My deskspace as it sits as of the beginning of March. I'll add a new pic to the album in a bit. Yeah, it's my deskspace, but maybe you do or don't notice all the extra PCs hidden in/on/around it. ;)
×
×
  • Create New...