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">&lt;<a href="mailto:stephan0h@gmx.net">stephan0h@gmx.net</a>&gt;</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&#39;m trying to use facebook&#39;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[&quot;fbs_&quot; + &quot;&lt;the application id&gt;&quot;]<br>
<br>
args=dict(map(lambda x:x.split(&#39;=&#39;),cookie.split(&#39;&amp;&#39;)))<br>
<br>
url=&quot;<a href="https://graph.facebook.com/me?access_token=" target="_blank">https://graph.facebook.com/me?access_token=</a>&quot;+args[&#39;access_token&#39;]<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 &#39;urlopen&#39; in this context<br>
-----------<br>
<br>
So the problem is with opening the external-url I suppose ...<br>
<br>
What&#39;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>