Skip to content

Api Access key for Baidu API & Tencent Youtu

Notifications You must be signed in to change notification settings

OpenSourceAIX/ApiAccess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ApiAccess

This is an App Inventor extension. 这是一个为App Inventor创建的拓展组件

Some work for getting access with Baidu AI api and Tencent Youtu

鉴于App Inventor的部分功能缺失,这里使用拓展来完成了百度AI开放平台腾讯优图的鉴权工作(签名生成)

Tutorial / 教程

BaiduApiAccess

Event / 事件

  • GotAuth(String auth)
    • Called when got auth key from baidu server.
    • 百度服务器返回授权签名之后调用此事件

Functions / 函数(方法)

  • GetAuth(String apiKey, String securetKey)
    • Call this to apply auth key and wait for it until receive the response.
    • 同步请求授权签名,会堵塞界面
  • GetAuthAsync(String apiKey, String securetKey)
    • Call this to apply auth key, event GotAuth will be called when receive the response.
    • 异步请求授权签名,获得签名后会调用GotAuth事件

YoutuApiAccess

Functions / 函数(方法)

  • Base64(String data)
  • ByteLength(String text)
    • Get byte length using default encoding of the system
    • 获取字符串在系统默认编码下的字节长度
  • ByteLengthWithEncoding(String text, String encoding)
    • Get byte length with specific encoding, e.g. utf-8
    • 获取字符串在用户指定编码下的字节长度,如utf-8
  • FormatString(String format, List arguments)
  • GetAuth(String appId, String secret_id, String secret_key)
    • Call this to calculate auth key.
    • 计算授权签名,本地操作,不会堵塞界面
  • MD5(String data)