【发布时间】:2014-08-22 08:03:54
【问题描述】:
我正在编写一个按计划将照片上传到 Instagram 的脚本。 Instagram 官方 API 不允许媒体上传。我发现今天唯一的解决方案是使用unofficial API。所以,我正在尝试使用它,但它对我的所有请求都响应 301 错误。
Ruby 代码:
url = 'https://instagr.am/api/v1/accounts/login/'
RestClient.post url, { username: 'username', password: 'password', device_id: '0000' }, user_agent: 'Instagram'
# RestClient::MovedPermanently: 301 Moved Permanently
或者卷曲:
$ curl -k --data "username=username&password=password&device_id=0000" --header "User-Agent: Instagram" https://instagr.am/api/v1/accounts/login/
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
您能否帮我找出我的请求中的错误或提出更好的解决方案如何将媒体上传到 Instagram?
【问题讨论】:
标签: ruby curl upload instagram