ok, i tried it and it works. =D My next edition will probably be released on the weekend.
EDIT: LOL i tried again but i got an error:
#!/bin/env python
# Pop out mode for meebo rooms widget
# This takes in a mandatory id that is the hash of the room we're popping out
# width and height are optional to specify how big or small to resize the popped out window to
import cgi
import sys
import os
import traceback
import re
def write_google_analytics():
print '''
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='/forum/" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3931792-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
'''
def main(arg_list, arg_dict):
try:
# validate inputs
widget_id_re = re.compile('\w{10}')
if widget_id_re.match(arg_dict['id']) is None:
raise Exception('widget id not formatted properly')
# validate width and height are numbers
number_re = re.compile('\d+')
embed_args = {}
embed_args['width'] = 430
if 'width' in arg_dict and number_re.match(arg_dict['width']) is not None:
embed_args['width'] = arg_dict['width']
if int(embed_args['width']) < 160:
embed_args['width'] = 160
embed_args['height'] = 300
if 'height' in arg_dict and number_re.match(arg_dict['height']) is not None:
embed_args['height'] = arg_dict['height']
if int(embed_args['height']) < 200:
embed_args['height'] = 200
embed_args['widget_url'] = 'http://widget.meebo.com/mcr.swf?id=' + arg_dict['id']
print "Content-type: text/html"
print "Status: 200"
print
embedcode = "<object width=\"%(width)s\" height=\"%(height)s\"><param name=\"movie\" value=\"%(widget_url)s\"></param><embed src=\"%(widget_url)s\" type=\"application/x-shockwave-flash\" width=\"%(width)s\" height=\"%(height)s\" /></object>" % embed_args
resizecode = "<script type=\"text/javascript\">function resize() { window.resizeBy(%(width)s-(document.body.clientWidth),%(height)s-(document.body.clientHeight));}</script>" % embed_args
print '<html><head><title>Meebo Rooms</title>' + resizecode + '</head><body style="overflow:hidden;padding:0px;margin:0px;" onload="resize()">'
print embedcode
write_google_analytics()
print '</body></html>'
except Exception, e:
print >> sys.stderr, e
traceback.print_exc(file=sys.stderr)
sys.stdout.write("Status: 302 Found\r\nLocation: http://www.meebo.com/rooms/\r\n\r\n")
if __name__=="__main__":
args = cgi.FieldStorage()
if len(sys.argv) > 1:#Command line arguments
if len(sys.argv) % 2 == 0:
print >> sys.stderr, "Malformed command line"
print >> sys.stderr, "usage ex: rooms_popout.py -id widget_hash_id"
sys.exit(1)
arg = None
args = {}
for item in sys.argv[1:]:
if arg is None:
arg = item[1:]
else:
args[arg] = item
arg = None
else: # cgi arguments
args = dict([(arg, args.getfirst(arg)) for arg in args])
if args is None:
args = {}
main(sys.argv, args)
Can anyone help me with this the chat room link is:
http://www.meebo.com/rooms_popout.py...430&height=300
EDIT2: i tryied it with firefox. tries to make me save a py file (blender)
EDIT3: I tried to put the embedded source code into it via html, but failed...
embedded: <div style="width:430px"> <style>.mcrmeebo { display: block; background:url("http://widget.meebo.com/images/r.gif") no-repeat top right; } .mcrmeebo:hover { background:url("http://widget.meebo.com/images/ro.gif") no-repeat top right; } </style><object width="430" height="300"><param name="movie" value="http://widget.meebo.com/mcr.swf?id=YKNjZVybel"/><embed src="http://widget.meebo.com/mcr.swf?id=YKNjZVybel" type="application/x-shockwave-flash" width="430" height="300" /></object><a href="http://www.meebo.com/rooms" class="mcrmeebo" target="_BLANK"><img alt="http://www.meebo.com/rooms" src="http://widget.meebo.com/images/b.gif" width="430" height="45" style="border:0px"/></a></div>