Social Media

Social Media

Postby NoyzSource » Wed Jun 30, 2010 12:14 am

I have automated the trail conditions update using Twitter and identi.ca. Ken or I can send a message to the Twitter account to update the trails. Every 30 minutes the script will check for new condition updates, update the website, and send a message to Twitter and Identi.ca of what the current trail conditions are. This does not tie into Facebook or Google Buzz. I do not know if it ever will unless the Twidge program I'm using starts supporting Ping.fm for updates.

To get updates instantly on your cell phone you can do the following.

Get a Twitter account.
Link your Cell Phone/SMS to Twitter.
Follow BeverlyPark.
Allow mobile updates from BeverlyPark.

If I update/change/refresh the trail status you will be sent a text message via Twitter shortly after the website gets the image updated. This typically happens within a minute of the update but sometime Twitter doesn't send stuff out right away and can delay it by 15 minutes or so.
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Social Media

Postby urbanbigfoot » Wed Jun 30, 2010 7:57 am

Cool stuff. From this day forward, I shall refer to you as "the Geek Master Flash." Sir, I bow before your awesomeness. :clap:
When I was a kid, I rode bikes. Now I ride bikes and act like a kid. Some things never change.
User avatar
urbanbigfoot
 
Posts: 401
Joined: Wed Mar 24, 2010 1:51 pm
Location: Marion, Iowa

Re: Social Media

Postby Ken » Sun Jul 04, 2010 6:53 am

Just sent my first tweet in almost a year... twitter.com/knbrkr

I will refuse until the very last minute to get this stuff on my phone, so will probably have it next week when we get back.

haha peace

btw, thanks for the tech hookup Noyz
User avatar
Ken
Site Admin
 
Posts: 1819
Joined: Sun Aug 19, 2007 9:47 pm
Location: Cedar Rapids

Re: Social Media

Postby Farmboy » Sun Jul 04, 2010 7:56 am

Don't do it man. I've regressed technologically. No more FB. Got rid of Crackberry last week. Feelin pretty good about it. I remember back in the day, the only to find out where the parties were going down was to drive down to the local gas station and hang out until you found out.

That was when I drove one of these:

Image

and had one of these (not me but very indicative of my hairstyle):

Image
If you're gonna be dumb, you better be tough.
User avatar
Farmboy
 
Posts: 1141
Joined: Tue Aug 21, 2007 10:30 pm
Location: Marion, IA

Re: Social Media

Postby NoyzSource » Sun Jul 04, 2010 8:08 pm

WooHoo! I hacked a different program written in python to work for us.

I hacked on the Terminal Pings script from http://www.pelikoira.net to get a working version for automating the LAMBA trail conditions status.

I changed the options so it didn't require a text input and made the options, arguments parsing just like the examples I had seen for getopts.

Here is the result.

Code: Select all
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, version 3 of the License

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import getopt
import string

#SET YOUR APP KEY HERE
user_app_key = ""
#DO NOT EDIT BELOW THIS LINE!

__version__ = "1.0 Final"
__api_key__ = "89d830faea826468d59d8bb7e68a721f"
#DO NOT EDIT __API_KEY__!!!

def usage():
   print " ####################################"
   print " ########## TERMINAL PINGS ##########"
   print " ########## Pinging ping.fm #########"
   print " ####################################"
   print "                HELP!!"
   print " #======================================#"
   print " #-v           - displays version number#"
   print " #--help       - displays this help     #"
   print " #-h           - displays this help     #"
   print " #-i           - show info screen       #"
   print " #--info       - show info screen       #"
   print " #--set-key    - helps you to set key   #"
   print " #-o         - send the arg to ping   #"
   print " #---                                   #"
   print " #-t           - test user api key      #"
   print " #-s           - sends status update    #"
   print " #--status     - sends status update    #"
   print " #-m           - send micro-blog post   #"
   print " #--micro-blog - send micro-blog post   #"
   print " #======================================#"

def info():
   print " ####################################"
   print " ########## TERMINAL PINGS ##########"
   print " ########## Pinging ping.fm #########"
   print " ####################################"
   print " Thanks for choosing terminal pings!"
   print " Currently this only supports status"
   print " updating and micro-blogging. Blogs are"
   print " not supported. Also updates are input"
   print " with raw_input(), so you can't make"
   print " your own script pinging trough this"
   print " script. I may make this working on"
   print " future versions... ;)"
   print " ---"
   print " This app generates .pingfm file to"
   print " directory where it is running. It"
   print " only contains user app key."
   print " ---"
   print " License:GPL3"
   print " If you make your own version, please"
   print " contact me so I can link you or host it"
   print " ---"
   print " 2008 Pelikoira"
   print " http://www.pelikoira.net"
   print " vuhvuh@pelikoira.net"
   print " ---"
   print " If you have question/bug/feature reguest"
   print " feel free to contact me! :)"
   exit(0)
   
def set_key():
   print "Setting your app key is simple. First"
   print "goto http://ping.fm/key and get your"
   print "key. Then open pingfm.py on your editor"
   print "and add your key on line 19"
   exit(0)

def version():
   print "version:"+__version__

def status():
   message = output #raw_input('Status update:')
   message.replace(' ', '&#32;')
   
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+ user_app_key +"&post_method=status&body="+ message +"' -O .pingfm_cache  http://api.ping.fm/v1/user.post")
   
   print "===== API output ====="
   #Printataan uloste
   os.system("cat .pingfm_cache")
   #poistetaan cache
   os.system("rm .pingfm_cache")
   exit(0)

def micro():
   fileHandle = open('.pingfm')
   user_api_key = fileHandle.readline()
   fileHandle.close()
   
   user_api_key.replace('\n', '')
   user_api_key.replace('\r', '')
   
   message = raw_input('Micro-blog post:')
   message.replace(' ', '&#32;')
   
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+user_app_key+"&post_method=microblog&body="+ message +"' -O .pingfm_cache http://api.ping.fm/v1/user.post")
   print "===== API output ====="
   os.system("cat .pingfm_cache")
   os.system("rm .pingfm_cache")
   exit(0)

def authenticate_api_key():
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+user_app_key+"&null_string=null' -O .pingfm_cache http://api.ping.fm/v1/user.services")
   # printataan tiedot ulos
   print "===== API output ====="
   os.system("cat .pingfm_cache")
   #ja poistetaan se
   os.system("rm .pingfm_cache")
   exit(0)

if __name__ == "__main__":
    from sys import argv, exit
    from getopt import getopt

    opts, args = getopt(argv[1:],"shtvmio:",["help", "test","status","micro-blog","info","set-key"])

    for o, a in opts:
        if o == "-h":
                usage()
                exit(0)
        elif o == "-v":
                version()
                exit(0)
        elif o == "-s":
      status()
      exit(0)
        elif o == "--status":
      status()
      exit(0)
        elif o == "-t":
               authenticate_api_key()
               exit(0)
        elif o == "--help":
                usage()
                exit(0)
   elif o == "-m":
      micro()
      exit(0)
   elif o == "--micro-blog":
      micro()
      exit(0)
   elif o == "-i":
      info()
      exit(0)
   elif o == "--set-key":
      set_key()
      exit(0)
   elif o == "-o":
      output = a
      print a
      status()
      exit(0)
      
usage()
exit(0)
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Social Media

Postby urbanbigfoot » Mon Jul 05, 2010 11:03 am

NoyzSource wrote:Here is the result.


Now you're talking my language. Well, python isn't my favorite, but it'll do in a pinch. Geek speak is cool! Rock-on Geek Master Flash!
When I was a kid, I rode bikes. Now I ride bikes and act like a kid. Some things never change.
User avatar
urbanbigfoot
 
Posts: 401
Joined: Wed Mar 24, 2010 1:51 pm
Location: Marion, Iowa

Re: Social Media

Postby musthavemuzk » Fri Jul 09, 2010 10:15 am

NoyzSource wrote:WooHoo! I hacked a different program written in python to work for us.

I hacked on the Terminal Pings script from http://www.pelikoira.net to get a working version for automating the LAMBA trail conditions status.

I changed the options so it didn't require a text input and made the options, arguments parsing just like the examples I had seen for getopts.

Here is the result.

Code: Select all
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, version 3 of the License

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import getopt
import string

#SET YOUR APP KEY HERE
user_app_key = ""
#DO NOT EDIT BELOW THIS LINE!

__version__ = "1.0 Final"
__api_key__ = "89d830faea826468d59d8bb7e68a721f"
#DO NOT EDIT __API_KEY__!!!

def usage():
   print " ####################################"
   print " ########## TERMINAL PINGS ##########"
   print " ########## Pinging ping.fm #########"
   print " ####################################"
   print "                HELP!!"
   print " #======================================#"
   print " #-v           - displays version number#"
   print " #--help       - displays this help     #"
   print " #-h           - displays this help     #"
   print " #-i           - show info screen       #"
   print " #--info       - show info screen       #"
   print " #--set-key    - helps you to set key   #"
   print " #-o         - send the arg to ping   #"
   print " #---                                   #"
   print " #-t           - test user api key      #"
   print " #-s           - sends status update    #"
   print " #--status     - sends status update    #"
   print " #-m           - send micro-blog post   #"
   print " #--micro-blog - send micro-blog post   #"
   print " #======================================#"

def info():
   print " ####################################"
   print " ########## TERMINAL PINGS ##########"
   print " ########## Pinging ping.fm #########"
   print " ####################################"
   print " Thanks for choosing terminal pings!"
   print " Currently this only supports status"
   print " updating and micro-blogging. Blogs are"
   print " not supported. Also updates are input"
   print " with raw_input(), so you can't make"
   print " your own script pinging trough this"
   print " script. I may make this working on"
   print " future versions... ;)"
   print " ---"
   print " This app generates .pingfm file to"
   print " directory where it is running. It"
   print " only contains user app key."
   print " ---"
   print " License:GPL3"
   print " If you make your own version, please"
   print " contact me so I can link you or host it"
   print " ---"
   print " 2008 Pelikoira"
   print " http://www.pelikoira.net"
   print " vuhvuh@pelikoira.net"
   print " ---"
   print " If you have question/bug/feature reguest"
   print " feel free to contact me! :)"
   exit(0)
   
def set_key():
   print "Setting your app key is simple. First"
   print "goto http://ping.fm/key and get your"
   print "key. Then open pingfm.py on your editor"
   print "and add your key on line 19"
   exit(0)

def version():
   print "version:"+__version__

def status():
   message = output #raw_input('Status update:')
   message.replace(' ', '&#32;')
   
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+ user_app_key +"&post_method=status&body="+ message +"' -O .pingfm_cache  http://api.ping.fm/v1/user.post")
   
   print "===== API output ====="
   #Printataan uloste
   os.system("cat .pingfm_cache")
   #poistetaan cache
   os.system("rm .pingfm_cache")
   exit(0)

def micro():
   fileHandle = open('.pingfm')
   user_api_key = fileHandle.readline()
   fileHandle.close()
   
   user_api_key.replace('\n', '')
   user_api_key.replace('\r', '')
   
   message = raw_input('Micro-blog post:')
   message.replace(' ', '&#32;')
   
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+user_app_key+"&post_method=microblog&body="+ message +"' -O .pingfm_cache http://api.ping.fm/v1/user.post")
   print "===== API output ====="
   os.system("cat .pingfm_cache")
   os.system("rm .pingfm_cache")
   exit(0)

def authenticate_api_key():
   os.system("wget --post-data 'api_key="+ __api_key__ +"&user_app_key="+user_app_key+"&null_string=null' -O .pingfm_cache http://api.ping.fm/v1/user.services")
   # printataan tiedot ulos
   print "===== API output ====="
   os.system("cat .pingfm_cache")
   #ja poistetaan se
   os.system("rm .pingfm_cache")
   exit(0)

if __name__ == "__main__":
    from sys import argv, exit
    from getopt import getopt

    opts, args = getopt(argv[1:],"shtvmio:",["help", "test","status","micro-blog","info","set-key"])

    for o, a in opts:
        if o == "-h":
                usage()
                exit(0)
        elif o == "-v":
                version()
                exit(0)
        elif o == "-s":
      status()
      exit(0)
        elif o == "--status":
      status()
      exit(0)
        elif o == "-t":
               authenticate_api_key()
               exit(0)
        elif o == "--help":
                usage()
                exit(0)
   elif o == "-m":
      micro()
      exit(0)
   elif o == "--micro-blog":
      micro()
      exit(0)
   elif o == "-i":
      info()
      exit(0)
   elif o == "--set-key":
      set_key()
      exit(0)
   elif o == "-o":
      output = a
      print a
      status()
      exit(0)
      
usage()
exit(0)


so this means what to us mere mortals who dont speek geek?
i do like the idea of getting updates by sms though.
and well since i now live in CR i suppose i need to get in the loop for things here
User avatar
musthavemuzk
 
Posts: 115
Joined: Mon Apr 26, 2010 11:36 am
Location: Cedar Rapids


Return to Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest