Vicente Guallart - Hyperhabitat

Posted by admin on November 8th, 2008

Hyperhabitat is a research project initiated at IaaC in 2005, directed by Vicente Guallart, with input from Daniel Ibáñez and Rodrigo Rubio.

Its purpose is to develop a new approach to the organization of the habitability of the world on the basis of information technology.

The first objective has been to establish whether the physical world can have a structure similar to the digital world. In effect, if a network is made up of nodes, connections, an environment and protocols that relate its content, in the case of the physical world, the world can be understood as a superposing of natural environments, the networks that crisscross it and functional nodes.

The years 2006 and 2007 have been spent working on nodes and networks, and the work on environments and protocols will begin in the near future

see website here

Showing Twitter Status On Your Group Blog

Posted by rajbot on November 8th, 2008

First a bit of meta discussion: I changed the left sidebar of TikiRobot to show the five most recent status updates from the fellow robots! It was kind of silly to display twits from people who haven’t updated since last year. If you want your status to show up in the sidebar, and it isn’t there for some reason, lemme know!

Twitter has an API for showing for retrieving the most recent status updates from your friends, so I created a new twitter user to follow the tikirobot posters. Then, I used this python script to fetch the friends timeline and spit out html for the blog. I wanted to do this all in javascript, but the the friends timeline api needs authentication, and I didn’t want to publicize the twitter account password. Plus, this way I can cache the data on our server, so it doesn’t hit twitter so often.

PYTHON:
  1. #!/usr/bin/python2.5
  2. #Copyright(c)2008 TikiRobot.net - Software license GPL version 3.
  3.  
  4. import time
  5. import datetime
  6. import os
  7. import fcntl
  8. import sys
  9. import codecs
  10. import re
  11.  
  12. # main()
  13. #_______________________________________________________________________________
  14. print “”“Content-type: text/javascript; charset=UTF-8\n““”
  15.  
  16. useCachedRss = True
  17. cacheFile    = ‘cache/twitter.json’
  18. sys.stdout = codecs.getwriter(‘utf8′)(sys.stdout)
  19.  
  20. try:
  21.     stats = os.stat(cacheFile)
  22.     if (time.time() - stats.st_mtime)> 300:
  23.         #cache expired
  24.         useCachedRss = False
  25. except OSError:
  26.     #cache file not found
  27.     useCachedRss = False
  28.  
  29. if useCachedRss:
  30.     try:
  31.         #print "reading cached json"
  32.         fh = open(cacheFile, ‘r’)
  33.         fcntl.lockf(fh, fcntl.LOCK_SH)
  34.         contents = fh.read()
  35.         fcntl.lockf(fh, fcntl.LOCK_UN)
  36.         fh.close()   
  37.     except:
  38.         print “got some kind of error when reading cached json. quitting”
  39.         sys.exit()
  40. else:
  41.     try:
  42.         #print "fetching new json"
  43.         import urllib2
  44.         apiurl = ‘http://twitter.com/statuses/friends_timeline.json?count=5′
  45.         auth_handler = urllib2.HTTPBasicAuthHandler()
  46.         auth_handler.add_password(
  47.             realm=‘Twitter API’,
  48.             uri=apiurl,
  49.             user=‘username’,
  50.             passwd=‘password’
  51.         )
  52.         opener = urllib2.build_opener(auth_handler)           
  53.         urllib2.install_opener(opener)
  54.         urlfh = urllib2.urlopen(apiurl)
  55.         contents = urlfh.read()
  56.         urlfh.close()
  57.         fh = open(cacheFile, ‘w’)
  58.         fcntl.lockf(fh, fcntl.LOCK_EX)
  59.         fh.write(contents)
  60.         fcntl.lockf(fh, fcntl.LOCK_UN)
  61.         fh.close()
  62.     except:
  63.         print “got some kind of error when fetching twitter timeline. quitting”
  64.         sys.exit()
  65.  
  66.  
  67. import json
  68. timeline = json.read(contents)
  69. htmlstr = “”
  70. for i in range(5):
  71.     name = timeline[i][‘user’][’screen_name’]
  72.     imgurl = re.sub(r‘_normal.(jpg|png)$’, r‘_mini.\1‘, timeline[i][‘user’][‘profile_image_url’])
  73.     twit   = re.sub(r‘\’‘, ‘'’, timeline[i][‘text’])
  74.     twit   = re.sub(r‘\n‘, ‘ ‘, twit)
  75.     twit   = re.sub(r‘http://tinyurl.com/(\S+)’, r‘<a href="http://tinyurl.com/\1">http://tinyurl.com/\1</a>’, twit)
  76.     htmlstr += “”“<div class=”twitter“>”“”
  77.     htmlstr += “”“<a href=”http://twitter.com/%s“><img src=”%s“/><strong>%s</strong></a>:”“”%(name, imgurl, name)
  78.     htmlstr += “”“   ”“” + twit
  79.     htmlstr += “”“   <span class=”twitterMeta“>”“”
  80.     htmlstr += ‘- sent ‘ + timeline[i][‘created_at’][0:-11]
  81.     htmlstr += “”“</span>”“”
  82.     htmlstr += “”“</div>”“”
  83.    
  84. print “”“var tikiTwits = ‘”“”+htmlstr+“”“‘;”“”
  85. print “”“document.write(tikiTwits);”“”

It’s fun to see that Twitter still uses the Javascript API that I proposed to them over the phone a couple years ago.

Also, dear lazyweb: please send my a python function that converts a UTC date string to PST. Thanks!

Amazing Toy Car Races Around Walls and Ceilings (Video)

Posted by Lem on November 8th, 2008
No, that photo isn't rotated incorrectly. The amazing new AeroSpider RC car from TOMY can actually race up and down walls, and even runs around on your ceiling. We managed to log some hands-on time (video below) with one earlier this week, and found it was really a blast. We're planning to pick up a couple of them - one just to play with, and one to disassemble and figure...

All posts are coming via feeds from websites listed in contributers. 2008 Robots Blog.
sql - private krankenversicherung - Joomla - Rss Feeds - Art Gallery - Free Myspace Layouts