I recently blogged about making a scopes in 5 minutes using youtube. I have seen also a fair amount of new scopes being created using RSS. By far, my favourite way to use scopecreator is Twitter.
If you want to check a few examples, I have published previously twitter-based scopes like breaking news, la liga and a few others. Today, I give you Formula One:
The interesting thing about twitter is that many brands upload minute by minute new updates, which make a really good source for scopes.
To create a Formula One scope,I started by going to twitter and creating a list under my scope account (you can use your personal account). The list contains several relevant “official” Formula One accounts. Using Twitter, I can then update the sources by adding and removing accounts from the list without the user needing to download an update for the scope.
Again, it took me about 5 min to get a working version of the scope. Here is what needed to do:
- First, we followed Chris’ instructions to install the scope creator tool.
- Once we had it set up on my laptop, I run:
scopecreator create twitter vtuson f1
cd f1 - Next, I configured the scope. The configuration is done in a json file called manifest.json. This file describes the content of what you will publish later to the store. You need to care about: “title”, “description”, “version” and “mantainer”. The rest are values populated by the tool:
scopecreator edit config
{
"description": "Formula One scope",
"framework": "ubuntu-sdk-14.10",
"architecture": "armhf",
"hooks": {
"f1": {
"scope": "f1",
"apparmor": "scope-security.json"
}
},
"icon": "icon",
"maintainer": "Your Name <yourname@packagedomain>",
"name": "f1.vtuson",
"title": "Formula One",
"version": "0.2"
}
- The following step was to set up the branding: Easy! Branding is define on an .ini file. “Display name” will be the name listed on the “manage” window once installed, and also will be the title of your scope if you don’t use a “PageHeader.Logo”. the [Appearance] section describes the colours and logos to use when banding a scope.
scopecreator edit branding
[ScopeConfig]
ScopeRunner=./f1.vtuson_f1 --runtime %R --scope %S
DisplayName=Formula One
Description=This is an Ubuntu search plugin that enables information from Yelp $
Author=Canonical Ltd.
Art=
Icon=images/icon.png
SearchHint=Search
[Appearance]
PageHeader.Background=color:///#D51318
PageHeader.ForegroundColor=#FFFFFF
PreviewButtonColor=#D51318 - The final part is to define the departments (drop down menu) for the scope. This is also a json file and it is unique the twitter scope template. You can either use “list” or “account” (or both) as departments. The id is the twitter handle for the list or the account. For lists you will need to specify in the configuration section what account holds the list. As I defined a single entry, the formula one scope will have no drop down menu.
scopecreator edit channels
{
“departments”: [
{
“name”:”Formula One”,
“type”:”list”,
“id”:”f1″
}
],
“configuration”: {
“list-account”:”canonical_scope”,
“openontwitter”:”See in Twitter”,
“openlink”:”Open”,
“retweet”:”Retweet”,
“favorite”: “Favourite”,
“reply”:”Reply”
}
}
After this, the only thing left to do is replace the placeholder icon, with a relevant logo:
~/f1/f1/images/logo.png
And build, check and publish the scope:
scopecreator build
This last command generates the click file that you need to upload to the store. If you have a device (for example a Nexus4 or an emulator ), it can also install it so you can test it. If you get any issues getting the scope to run, you might want to check your json files on http://jsonlint.com/. It is a great web tool that will help you make sure your json doc is ship shaped!
It is super simple to create a scope for a twitter list! so what are you going to create next?