urlopen is restricted python. You will need to create file system script (a product) (or external script) in order to use it. <br><br><div class="gmail_quote">On Mon, Nov 15, 2010 at 8:43 AM, <span dir="ltr"><<a href="mailto:stephan0h@gmx.net">stephan0h@gmx.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
I'm trying to use facebook's single-sign-on mechanism with zope and<br>
querying account information for logged in facebook-users from within zope.<br>
<br>
For this I need to send url-requests from my zope-server to the<br>
facebook-servers and read the response. I tried to test the concept with<br>
a python-script:<br>
<br>
##############<br>
import urllib<br>
<br>
cookie= request["fbs_" + "<the application id>"]<br>
<br>
args=dict(map(lambda x:x.split('='),cookie.split('&')))<br>
<br>
url="<a href="https://graph.facebook.com/me?access_token=" target="_blank">https://graph.facebook.com/me?access_token=</a>"+args['access_token']<br>
<br>
file = urllib.urlopen(url)<br>
resp=file.read()<br>
file.close()<br>
<br>
return args,url,resp<br>
##############<br>
<br>
When running this an authentication-window pops up - and subsequently<br>
tells me:<br>
<br>
-----------<br>
Error Type: Unauthorized<br>
Error Value: You are not allowed to access 'urlopen' in this context<br>
-----------<br>
<br>
So the problem is with opening the external-url I suppose ...<br>
<br>
What's the Zope-way of doing this? - how can I tell it to get read<br>
information of another URL?<br>
<br>
thanks,<br>
stephan<br>
_______________________________________________<br>
Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/zope" target="_blank">https://mail.zope.org/mailman/listinfo/zope</a><br>
** No cross posts or HTML encoding! **<br>
(Related lists -<br>
<a href="https://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">https://mail.zope.org/mailman/listinfo/zope-announce</a><br>
<a href="https://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</blockquote></div><br><br clear="all"><br>-- <br>David Bear<br>College of Public Programs at ASU<br>602-494-0424<br>