pogo-Go Pokémon Go API 工具 pogo-Go

agolangf • 1669 次点击    
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
pogo 采用 Golang 开发的Pokémon Go API 工具。 安装: <pre class="brush:shell;toolbar: true; auto-links: false;">$ go get -u github.com/pkmngo-odi/pogo</pre> 使用: 获取玩家profile(轮廓) <pre class="brush:shell;toolbar: true; auto-links: false;">$ pogo -u &lt;username&gt; -p &lt;Secret1234&gt; --lat 0.0 --lon 0.0 player</pre> 配置环境变量: <pre class="brush:cpp ;toolbar: true; auto-links: false;">export POGO_ACCOUNT_USERNAME=MyUserAccount export POGO_ACCOUNT_USERNAME=PasswordThatIsSecret $ pogo --lat 0.0 --lon 0.0 player</pre> 示例(检索玩家数据,并以JSON数据形式打印出来): <pre class="brush:cpp ;toolbar: true; auto-links: false;">package main import (   &#34;encoding/json&#34;   &#34;fmt&#34;   &#34;github.com/pkmngo-odi/pogo/api&#34;   &#34;github.com/pkmngo-odi/pogo/auth&#34; ) func main() {   // Initialize a new authentication provider to retrieve an access token   provider, err := auth.NewProvider(&#34;ptc&#34;, &#34;MyUser&#34;, &#34;Pass1!!&#34;)   if err != nil {     fmt.Println(err)     return   }   // Set the coordinates from where you&#39;re connecting   location := &amp;api.Location{     Lon: 0.0,     Lat: 0.0,     Alt: 0.0,   }   // Start new session and connect   session := api.NewSession(provider, location, false)   session.Init()   // Start querying the API   player, err := session.GetPlayer()   if err != nil {     fmt.Println(err)     return   }   out, err := json.Marshal(player)   if err != nil {     fmt.Println(err)     return   }   fmt.Println(string(out)) }</pre>
授权协议:
MIT
开发语言:
Google Go 查看源码»
操作系统:
跨平台
1669 次点击  
加入收藏 微博
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传