<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Activities%2FTurtleArt%2FFb_plugin.py</id>
	<title>Activities/TurtleArt/Fb plugin.py - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Activities%2FTurtleArt%2FFb_plugin.py"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;action=history"/>
	<updated>2026-04-18T21:14:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83946&amp;oldid=prev</id>
		<title>Walter at 14:28, 7 November 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83946&amp;oldid=prev"/>
		<updated>2012-11-07T14:28:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:28, 7 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l129&quot;&gt;Line 129:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 129:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader = FbUploader(image_file, self._access_token)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader = FbUploader(image_file, self._access_token)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader.doit()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader.doit()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Walter</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83945&amp;oldid=prev</id>
		<title>Walter at 14:28, 7 November 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83945&amp;oldid=prev"/>
		<updated>2012-11-07T14:28:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:28, 7 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l128&quot;&gt;Line 128:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 129:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader = FbUploader(image_file, self._access_token)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader = FbUploader(image_file, self._access_token)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader.doit()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         uploader.doit()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Walter</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83944&amp;oldid=prev</id>
		<title>Walter: Created page with &quot;#!/usr/bin/env python # # Copyright (c) 2012 Raul Gutierrez S. - rgs@itevenworks.net  #Permission is hereby granted, free of charge, to any person obtaining a copy #of this so...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/TurtleArt/Fb_plugin.py&amp;diff=83944&amp;oldid=prev"/>
		<updated>2012-11-07T14:27:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;#!/usr/bin/env python # # Copyright (c) 2012 Raul Gutierrez S. - rgs@itevenworks.net  #Permission is hereby granted, free of charge, to any person obtaining a copy #of this so...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;#!/usr/bin/env python&lt;br /&gt;
#&lt;br /&gt;
# Copyright (c) 2012 Raul Gutierrez S. - rgs@itevenworks.net&lt;br /&gt;
&lt;br /&gt;
#Permission is hereby granted, free of charge, to any person obtaining a copy&lt;br /&gt;
#of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal&lt;br /&gt;
#in the Software without restriction, including without limitation the rights&lt;br /&gt;
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&lt;br /&gt;
#copies of the Software, and to permit persons to whom the Software is&lt;br /&gt;
#furnished to do so, subject to the following conditions:&lt;br /&gt;
&lt;br /&gt;
#The above copyright notice and this permission notice shall be included in&lt;br /&gt;
#all copies or substantial portions of the Software.&lt;br /&gt;
&lt;br /&gt;
#THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&lt;br /&gt;
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&lt;br /&gt;
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&lt;br /&gt;
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN&lt;br /&gt;
#THE SOFTWARE.&lt;br /&gt;
&lt;br /&gt;
# NOTE: This is a plugin to enable uploading of Turtle Art projects to&lt;br /&gt;
# Facebook. It currently works for the GTK3 version of Turtle Blocks and&lt;br /&gt;
# only from the GNOME desktop.&lt;br /&gt;
# USAGE: Download this file into the gnome_plugin directory; make sure the&lt;br /&gt;
# filename is fb_plugin.py (Mediawiki capitalizes the first letter of files).&lt;br /&gt;
# When you launch TA from the GNOME desktop by running turtleblocks.py&lt;br /&gt;
# you should see a new menu, Facebook, which allows you to upload your&lt;br /&gt;
# project. Please report any problems to rgs and walter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import pycurl&lt;br /&gt;
import sys&lt;br /&gt;
import urlparse&lt;br /&gt;
&lt;br /&gt;
from gi.repository import Gtk&lt;br /&gt;
from gi.repository import WebKit&lt;br /&gt;
from plugin import Plugin&lt;br /&gt;
from util.menubuilder import MenuBuilder&lt;br /&gt;
from gettext import gettext as _&lt;br /&gt;
&lt;br /&gt;
class FbUploader():&lt;br /&gt;
    UPLOAD_URL = &amp;quot;https://graph.facebook.com/me/photos?access_token=%s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, image_path, access_token):&lt;br /&gt;
        self._image_path = image_path&lt;br /&gt;
        self._access_token = access_token&lt;br /&gt;
&lt;br /&gt;
    def doit(self):&lt;br /&gt;
        c = pycurl.Curl()&lt;br /&gt;
        c.setopt(c.POST, 1)&lt;br /&gt;
        c.setopt(c.URL,  self._get_url())&lt;br /&gt;
        c.setopt(c.HTTPPOST, self._get_params(c))&lt;br /&gt;
        c.perform()&lt;br /&gt;
        print c.getinfo(c.HTTP_CODE)&lt;br /&gt;
&lt;br /&gt;
    def _get_url(self):&lt;br /&gt;
        return self.UPLOAD_URL % (self._access_token)&lt;br /&gt;
&lt;br /&gt;
    def _get_params(self, c):&lt;br /&gt;
        params = []&lt;br /&gt;
        params.append((&amp;#039;source&amp;#039;, (c.FORM_FILE, self._image_path)))&lt;br /&gt;
&lt;br /&gt;
        return params&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Fb_plugin(Plugin):&lt;br /&gt;
    APP_ID = &amp;quot;172917389475707&amp;quot;&lt;br /&gt;
    REDIRECT_URI = &amp;quot;http://www.sugarlabs.org&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, parent):&lt;br /&gt;
        self._access_token = &amp;quot;&amp;quot;&lt;br /&gt;
        self._auth_win = None&lt;br /&gt;
&lt;br /&gt;
    def get_menu(self):&lt;br /&gt;
        menu = Gtk.Menu()&lt;br /&gt;
        MenuBuilder.make_menu_item(menu, _(&amp;#039;Wall post&amp;#039;),&lt;br /&gt;
                                   self._post_menu_cb)&lt;br /&gt;
        upload_menu = MenuBuilder.make_sub_menu(menu, _(&amp;#039;Facebook&amp;#039;))&lt;br /&gt;
        return upload_menu&lt;br /&gt;
&lt;br /&gt;
    def set_tw(self, turtleart_window):&lt;br /&gt;
        self.tw = turtleart_window&lt;br /&gt;
&lt;br /&gt;
    def enabled(self):&lt;br /&gt;
        return True&lt;br /&gt;
&lt;br /&gt;
    def _post_menu_cb(self, widget):&lt;br /&gt;
        if self._access_token == &amp;quot;&amp;quot;:&lt;br /&gt;
            self._grab_fb_app_token()&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        self._post_to_fb()&lt;br /&gt;
&lt;br /&gt;
    def _grab_fb_app_token(self):&lt;br /&gt;
        url = self._get_auth_url()&lt;br /&gt;
        w = Gtk.Window()&lt;br /&gt;
        w.move(200, 200)&lt;br /&gt;
        w.set_size_request(800, 400)&lt;br /&gt;
        wkv = WebKit.WebView()&lt;br /&gt;
        wkv.load_uri(url)&lt;br /&gt;
        wkv.grab_focus()&lt;br /&gt;
        wkv.connect(&amp;#039;navigation-policy-decision-requested&amp;#039;, self._nav_policy_cb)&lt;br /&gt;
        w.add(wkv)&lt;br /&gt;
        w.show_all()&lt;br /&gt;
        self._auth_win = w&lt;br /&gt;
&lt;br /&gt;
    def _get_auth_url(self):&lt;br /&gt;
        url = &amp;quot;http://www.facebook.com/dialog/oauth?client_id=%s&amp;quot; % (self.APP_ID)&lt;br /&gt;
        url += &amp;quot;&amp;amp;redirect_uri=%s&amp;quot; % (self.REDIRECT_URI)&lt;br /&gt;
        url += &amp;quot;&amp;amp;response_type=token&amp;amp;scope=publish_stream&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        return url&lt;br /&gt;
&lt;br /&gt;
    def _nav_policy_cb(self, view, frame, req, action, param):&lt;br /&gt;
        uri = req.get_uri()&lt;br /&gt;
        if uri:&lt;br /&gt;
            url_o = urlparse.urlparse(uri)&lt;br /&gt;
            params = urlparse.parse_qs(url_o.fragment)&lt;br /&gt;
            if params.has_key(&amp;#039;access_token&amp;#039;):&lt;br /&gt;
                self._access_token = params[&amp;#039;access_token&amp;#039;][0]&lt;br /&gt;
                self._auth_win.hide()&lt;br /&gt;
                self._post_to_fb()&lt;br /&gt;
&lt;br /&gt;
    def _post_to_fb(self):&lt;br /&gt;
        ta_file, image_file = self.tw.save_for_upload(&amp;quot;ta fb&amp;quot;)&lt;br /&gt;
        uploader = FbUploader(image_file, self._access_token)&lt;br /&gt;
        uploader.doit()&lt;/div&gt;</summary>
		<author><name>Walter</name></author>
	</entry>
</feed>