使用 windows 代码导出 Yammer 数据

yammer data export using windows code

我尝试使用 Data_Export_API_Code_1_Windows

导出数据

我的参考 link :

https://developer.yammer.com/docs/data-export-api

我使用的是经过验证的管理员权限帐户

我创建了 .bat 文件并在其上复制脚本,将 <access token> 替换为管理员令牌,将 <directory> 替换为放置文件的目录路径。

我为 windows 安装 wget 并更新我的 PATH 环境变量以包含 GNU bin 路径。

我正在使用 windows 10

但是当我 运行 .bat 它打开控制台然后关闭它时没有任何改变,当我尝试从 cmd 运行 它显示这个图像

-ca-certificate我发现yammer参考中的windows代码不正确,有错误。 我更正了代码中的错误并执行,它 运行 成功并下载了文件。 修复后的正确代码

@ECHO OFF
SET AT=<OAuth Access Token>
SET DIR=<Export Path>
SET ExportSince=<Datetime in ISO- 8601 like [2016-02-13T00:00:00z]>

cd %DIR%
SETLOCAL EnableDelayedExpansion
::Preform the next export. Send the OAuth 2 access token and store the time of this export in the filename.
SET FILE_NAME=<[myfilename].zip>
SET AUTH_HEADER=Authorization: Bearer %AT%
SET API_URL=https://www.yammer.com/api/v1/export
IF NOT EXIST cacert.pem ( wget http://curl.haxx.se/ca/cacert.pem )
ECHO Downloading..
wget -O %FILE_NAME% -t 1 --header "%AUTH_HEADER%" -ca-certificate cacert.pem %API_URL%?since=%ExportSince%^&include=csv
ECHO Finish Download