Difference between revisions of "Web Services"

From Sugar Labs
Jump to navigation Jump to search
Line 10: Line 10:
 
# [https://github.com/ignaciouy/upload-webservice support for uploading files to PutLocker] (ignacio)
 
# [https://github.com/ignaciouy/upload-webservice support for uploading files to PutLocker] (ignacio)
  
[[File:Webservices.png|200px|A new controlpanel widget for managing services]]
+
[[File:Webservices.png|300px]]
  
[[File:Configpastebin.bmp|200px|An extra icon appears in "My Settings"; Example, configuring Pastebin]]
+
A new controlpanel widget for managing services
  
[[File:Copypastebin.png|200px|The Journal menu now allows you to copy an entry to your web service e.g. Pastebin]]
+
[[File:Configpastebin.bmp|300px]]
 +
 
 +
An extra icon appears in "My Settings"; Example, configuring Pastebin
 +
 
 +
[[File:Copypastebin.png|300px]]
 +
 
 +
The Journal menu now allows you to copy an entry to your web service e.g. Pastebin
  
 
We are working with community members on other extensions based on the framework and encourage other community members to work with us on additional services.
 
We are working with community members on other extensions based on the framework and encourage other community members to work with us on additional services.

Revision as of 07:56, 11 December 2013

As of Sugar 0.100, there is a mechanism for using web services from Sugar.

There is new section to the Sugar Control Panel to manage online accounts and some interventions to the Sugar Journal toolbars and palettes in order to expose any installed online services, adding Copy-to and Refresh capabilities to the Sugar Journal.

We have implemented several examples:

  1. support specific to Facebook: to share Journal entries on Facebook and to retrieve comments on those entries from Facebook (walter and rgs);
  2. support specific to Twitter: to share Journal entries as tweets and to retrieve comments on those entries from Twitter (tch);
  3. support for uploading text to Pastebin (tch);
  4. support for uploading Journal entries to a local server (tch).
  5. support for uploading files to PutLocker (ignacio)

Webservices.png

A new controlpanel widget for managing services

Configpastebin.bmp

An extra icon appears in "My Settings"; Example, configuring Pastebin

Copypastebin.png

The Journal menu now allows you to copy an entry to your web service e.g. Pastebin

We are working with community members on other extensions based on the framework and encourage other community members to work with us on additional services.

For now, web services implementations are welcome to handle their retrieval of tokens on their own. In the future we might want to delegate that to Gnome Online Accounts or a similar auth/token provider.

Installing web services

We don't yet have a simple installer for web services, so for the time being:

Using git

  1. cd ~/.sugar/default
  2. git clone <MY WEBSERVICE>.git

Demonstration

Using gunzip and tar

  1. cd ~/.sugar/default
  2. wget <MY WEBSERVICE>
  3. gunzip <MY WEBSERVICE>.tar.gz
  4. tar xvf <MY WEBSERVICE>.tar

Web services

Facebook

You should end up with the following directory structure:

~/.sugar/default/extensions/webservice/
├── __init__.py
└── facebook
    ├── __init__.py
    ├── account.py
    ├── facebook
    │   ├── __init__.py
    │   └── facebook.py
    └── icons
        ├── facebook-like-insensitive.svg
        ├── facebook-like.svg
        ├── facebook-refresh-insensitive.svg
        ├── facebook-refresh.svg
        ├── facebook-share-insensitive.svg
        └── facebook-share.svg

~/.sugar/default/extensions/cpsection/
├── __init__.py
└── webaccount
    ├── __init__.py
    └── services
        ├── __init__.py
        └── facebook
            ├── __init__.py
            └── service.py

PutLocker

You should end up with the following directory structure:

~/.sugar/default/extensions/webservice/
├── __init__.py
└── sugarupload
    ├── account.py
    ├── icons
    │   └── sugarupload.svg
    ├── __init__.py
    └── sugarupload
        ├── grestful
        │   ├── decorators.py
        │   ├── errors.py
        │   ├── helpers.py
        │   ├── __init__.py
        │   └── object.py
        ├── __init__.py
        └── sugarupload.py

~/.sugar/default/extensions/cpsection/
├── __init__.py
└── webaccount
    ├── __init__.py
    └── services
        ├── __init__.py
        └── sugarupload
            ├── __init__.py
            └── service.py

Proposals

See also

See also features/Web_services