Apply for app key
ALL SNSAPI users must apply their own application keys to enable a certain platform (if it requires OAuth).
Not only developers need a key!
All the OSNs we currently touch do not allow other users to authorize test stage Apps,
e.g. only the developer can authorize it.
In this case, everyone needs to register as a developer first and apply their own key.
Whenever you see sample usage of SNSAPI,
remember to change their app_key
and app_secret
to yours.
Alternatively, you can ask the key owner to assign you as a test user
if you really want to use others' keys.
Expiration: 3 months (for appkey owners)
Website: Tencent Open App Platform
This interface should be a good start for learning how to use snsapi. The application is easy while the authentication is also convenient.
"platform" = "TencentWeiboStatus"
"app_key"="your app key"
"app_secret"="your app secret"
nc["auth_info"]["callback_url"]= "your app callback_url"
Expiration: 5 years (for appkey owners)
Website: Sina Weibo Open App Platform
"platform" = "SinaWeiboStatus"
"app_key"="your app key"
"app_secret"="your app secret"
nc["auth_info"]["callback_url"]= "your app callback_url"
Expiration: No specific expiration date
Website: [Instagram Open App Platform] (http://instagram.com/developer/)
nc["platform"] = "InstagramFeed"
nc["app_key"] = "your app key"
nc["app_secret"] = "your app secret"
nc["auth_info"]["callback_url"]= "your app callback_url"
Expiration: 7 days
Website: [Douban API] (http://developers.douban.com/apikey/apply)
nc["platform"] = "DoubanFeed"
nc["app_key"] = "your app key"
nc["app_secret"] = "your app secret"
nc["auth_info"]["callback_url"]= "your app callback_url"
Expiration: 30 days
Website: Renren Open App Platform
nc['platform']="RenrenStatus"
nc['app_secret']="Renren app secret key"
nc['app_key']="Renren app id"
nc["channel_name"]="channel name"
nc["auth_info"]["callback_url"]="your call back url"
Expiration: NONE (for appkey owners)
Note, twitter do not need to authorize it every time. As developers, they provide you a permanent key to use. You can even get your app authority without waiting for their review. Very convenient!!
Procedure:
- Apply for your own twitter account at "https://twitter.com/" if you do not have one.
- Fill in the form at "https://dev.twitter.com/apps/new" and create your twitter application
- Click on Create My Access Token at the bottom of the page after finishing the form
- Now, you should configure the channel as follows.
"platform"="TwitterStatus"
"app_key" = "consumer key"
"app_secret" = "consumer secret"
"access_key" = "Access token"
"access_secret" = "Access token secret"
Note:
- Remember to set your application permission to "read+write" under the "Settings" tab.
Expiration: About an hour
Procedure:
- Refer to https://github.com/ivanchak/snsapi, there is a wiki (https://github.com/ivanchak/snsapi/wiki) showing the details.
- Generate your access token
- Configure the channel as follows.
"platform" = "FacebookStatus"
"access_token" = "your_access_token_here"
"app_key"="your app key"
"app_secret"="your app secret"
nc["auth_info"]["callback_url"]= "your app callback_url"
nc['platform']="Email"
nc['username']="your email username"
nc['password']="your email password"
nc['address']="your email address"
nc['imap_host'] = 'imap.gmail.com'
nc['imap_port'] = 993 #find the correct port number of you mail ISP. default IMAP + TLS port
nc['smtp_host'] = 'smtp.gmail.com'
nc['smtp_port'] = 587 #find the correct port number of you mail ISP. default SMTP + TLS port
"methods": "home_timeline",
"url": "rss_url",
"platform": "RSS",
"username": "sqlite username",
"methods": "update,forward",
"url": "database_file_name",
"user_name": "sqlite username",
"userid": "sqlite userid",
"platform": "SQLite",