Skip to content
wcyz666 edited this page Jul 27, 2014 · 23 revisions

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.

Tencent

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"

Sina

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"

Instagram

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"

Douban

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"

Renren APIv2.0

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"

Twitter

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:

  1. Apply for your own twitter account at "https://twitter.com/" if you do not have one.
  2. Fill in the form at "https://dev.twitter.com/apps/new" and create your twitter application
  3. Click on Create My Access Token at the bottom of the page after finishing the form
  4. 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.

Facebook

Expiration: About an hour

Procedure:

  1. Refer to https://github.com/ivanchak/snsapi, there is a wiki (https://github.com/ivanchak/snsapi/wiki) showing the details.
  2. Generate your access token
  3. 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"

Email

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

RSS

"methods": "home_timeline", 
"url": "rss_url", 
"platform": "RSS", 

SQLite

"username": "sqlite username", 
"methods": "update,forward", 
"url": "database_file_name", 
"user_name": "sqlite username", 
"userid": "sqlite userid", 
"platform": "SQLite",