Base recognizes no options, it’s only used for generate or checklink commands.
Blogger service recognizes the following options in brc.py:
service = 'blogger'
service_options = {
client_id: '<your client ID>',
client_secret: '<your client secret>',
'blog': <blog id>,
}
You can use blogs command to quickly get the blog ID.
You need to authorize b.py to access your Blogger account with your OAuth client ID. Simply using blogs command (see Commands section) to start the authorization process:
b.py blogs
Once you follow the prompted steps, there should be a b.dat created under the current working directory, you should keep it safe.
You will need to obtain a OAuth Client ID in order to use b.py.
b.dat is a credential file for Blogger service, it’s read by b.py from the current directory.
To create the file, please follow Authorization.
Bases: bpy.services.base.Service
WordPress service recognizes the following options in brc.py:
service = 'wordpress'
service_options = {
'blog': <blog url>,
'username': 'user01',
'password': 'secret',
}
blog should be the URL of WordPress blog, for example, http://<something>.wordpress.com/ or http://example.com/wordpress/. Note that the tailing slash must be included.
In order to use WordPress XML-RPC API, you must provide username and password.
Services’ IDs:
service | IDs |
---|---|
Base | base |
Blogger | b, blogger |
WordPress | wp, wordpress |
To assign options to chosen service, add service_options in brc.py, for example:
service = "<service id>"
service_options = {
'option1': 'value1',
'option2': 2,
}
A sample handler sample_service.py:
from bpy.service import base
class Service(base.Service):
# see bpy/services for examples
pass
And corresponding setting in brc.py:
import re
# this matches the re
service = 'foobar'
services = {
'SampleService': {
'match': re.compile(r'^foobar$'),
'module': 'sample_service',
},
}