2
* Copyright (C) 2012 Canonical, Inc
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20
* David King <david.king@canonical.com>
23
public class SohuPlugin : Ap.OAuthPlugin {
24
public SohuPlugin (Ag.Account account) {
25
Object (account: account);
30
var oauth_params = new HashTable<string, GLib.Value?> (str_hash, null);
31
oauth_params.insert ("RequestEndpoint",
32
"http://api.t.sohu.com/oauth/request_token");
33
oauth_params.insert ("TokenEndpoint",
34
"http://api.t.sohu.com/oauth/access_token");
35
oauth_params.insert ("AuthorizationEndpoint",
36
"http://api.t.sohu.com/oauth/authorize");
37
oauth_params.insert ("ConsumerKey", Config.SOHU_CONSUMER_KEY);
38
oauth_params.insert ("ConsumerSecret", Config.SOHU_CONSUMER_SECRET);
39
oauth_params.insert ("Callback", "http://www.ubuntu.com/");
40
set_oauth_parameters (oauth_params);
42
set_mechanism (Ap.OAuthMechanism.HMAC_SHA1);
46
public GLib.Type ap_module_get_object_type ()
48
return typeof (SohuPlugin);