# Path: sofine/plugins/plugin_base.py
# class PluginBase(object):
#     def __init__(self):
#     def get_adds_keys(self):
#     def parse_args(self, argv):
#     def get_schema(self, args=None):
#     def get_namespaced_schema(self):


import urllib
import urllib2
import json
from sofine.plugins import plugin_base as plugin_base
def get_child_schema():
    """An optional function which returns the list of child keys that are associated
with the parent key `results` defined in `self.schema`.

This API returns an array of JSON objects, with the possible fields shown in the example.
Hence the return type is list of lists, because this plugin returns
a list of objects, each with this possible set of keys.

Returns:

    [['GsearchResultClass', 'unescapedUrl', 'url', 'visibleUrl', 'cacheUrl', 'title', 
    'titleNoFormatting', 'content']]

Example of one of the child objects in the array associated with `results`:

    {
        "GsearchResultClass": "GwebSearch",
        "cacheUrl": "http://www.google.com/search?q=cache:XhbIlCyrcXMJ:finance.yahoo.com",
        "content": "View the basic <b>AAPL</b> stock chart on Yahoo! Finance. Change the date range, chart type and compare Apple Inc. against other companies.",
        "title": "<b>AAPL</b>: Summary for Apple Inc.- Yahoo! Finance",
        "titleNoFormatting": "AAPL: Summary for Apple Inc.- Yahoo! Finance",
        "unescapedUrl": "http://finance.yahoo.com/q?s=AAPL",
        "url": "http://finance.yahoo.com/q%3Fs%3DAAPL",
        "visibleUrl": "finance.yahoo.com"
    }
"""
    return [['GsearchResultClass', 'unescapedUrl', 'url', 'visibleUrl', 'cacheUrl', 'title', 
             'titleNoFormatting', 'content']]



# Path: sofine/plugins/plugin_base.py
# class PluginBase(object):
#     def __init__(self):
#     def get_adds_keys(self):
#     def parse_args(self, argv):
#     def get_schema(self, args=None):
#     def get_namespaced_schema(self):


# Path: sofine/plugins/example/google_search_results.py
import urllib
import urllib2
import json
from sofine.plugins import plugin_base as plugin_base

def get_child_schema():
    """An optional function which returns the list of child keys that are associated
with the parent key `results` defined in `self.schema`.

This API returns an array of JSON objects, with the possible fields shown in the example.
Hence the return type is list of lists, because this plugin returns
a list of objects, each with this possible set of keys.

Returns:

    [['GsearchResultClass', 'unescapedUrl', 'url', 'visibleUrl', 'cacheUrl', 'title', 
    'titleNoFormatting', 'content']]

Example of one of the child objects in the array associated with `results`:

    {
        "GsearchResultClass": "GwebSearch",
        "cacheUrl": "http://www.google.com/search?q=cache:XhbIlCyrcXMJ:finance.yahoo.com",
        "content": "View the basic <b>AAPL</b> stock chart on Yahoo! Finance. Change the date range, chart type and compare Apple Inc. against other companies.",
        "title": "<b>AAPL</b>: Summary for Apple Inc.- Yahoo! Finance",
        "titleNoFormatting": "AAPL: Summary for Apple Inc.- Yahoo! Finance",
        "unescapedUrl": "http://finance.yahoo.com/q?s=AAPL",
        "url": "http://finance.yahoo.com/q%3Fs%3DAAPL",
        "visibleUrl": "finance.yahoo.com"
    }
"""
    return [['GsearchResultClass', 'unescapedUrl', 'url', 'visibleUrl', 'cacheUrl', 'title', 
             'titleNoFormatting', 'content']]



class GoogleSearchResults(plugin_base.PluginBase):