简体   繁体   English

如何获得Twitter用户名列表(按其位置)?

[英]How can I get the list of Twitter user names by their location?

I've been using the twitter REST API and need to access the list of Twitter users by their location. 我一直在使用twitter REST API,需要按其位置访问Twitter用户列表。 I've looked through the GET request lists here: https://dev.twitter.com/rest/reference/get/users/lookup , but I can't seem to find the GET request that would accomplish what I need. 我在这里浏览了GET请求列表: https : //dev.twitter.com/rest/reference/get/users/lookup ,但是我似乎找不到能满足我需要的GET请求。 I am working with R and have looked at TwitteR but didn't find anything useful. 我正在与R合作,研究了TwitteR,但没有发现任何有用的东西。 and I am new to using APIs so any help would appreciated. 而且我对使用API​​还是陌生的,因此不胜感激。

To make a request, first load httr, then call GET() with a url: 要发出请求,请先加载httr,然后使用url调用GET():
library(httr) 库(HTTR)
r <- GET("http:enter your url here") r <-GET(“ http:在此处输入您的网址”)

you can use users/search and pass locations as a parameter with url 您可以使用用户/搜索并将位置作为参数传递给url

You need to change url to https://api.twitter.com/1.1/users/search.json?q=Toronto&page=1&count=3 您需要将网址更改为https://api.twitter.com/1.1/users/search.json?q=Toronto&page=1&count=3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM