stackexchange-api

StackExchange API - Deserialize Date in JSON Response

大兔子大兔子 提交于 2020-01-03 20:12:13
问题 I am trying to use stackexchange api. In this link I am trying to get some users information. If you run, it you will get the JSON response. { "items": [ { "badge_counts": { "bronze": 5630, "silver": 4212, "gold": 267 }, "account_id": 11683, "is_employee": false, "last_modified_date": 1398827800, "last_access_date": 1398799412, "reputation_change_year": 34829, "reputation_change_quarter": 7965, "reputation_change_month": 7965, "reputation_change_week": 930, "reputation_change_day": 60,

How to retrieve the “Related tags” of a tag using py-stackexchange?

感情迁移 提交于 2020-01-03 04:58:10
问题 Step 1: I would like to retrieve all the related tags of a particular tag using Py-stackexchange, much like what is accomplished here. Step 2: I would like to find the intersection between two lists of related tags. I am StackApp-agnostic, as long as it works! RELATED : Py-StackExchange filter by tag 回答1: Since Py-StackExchange does not support V2.0 yet, I struggled with Stackpy, but no luck there either (it could well be my incompetence too). However, SEAPI is clean, efficient and was a

JSON URL from StackExchange API returning jibberish?

这一生的挚爱 提交于 2019-12-30 10:06:10
问题 I have a feeling I'm doing something wrong here, but I'm not quite sure if I'm missing a step, or am just having an encoding problem or something. Here's my code: URL url = new URL("http://api.stackoverflow.com/0.8/questions/2886661"); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); // Question q = new Gson().fromJson(in, Question.class); String line; StringBuffer content = new StringBuffer(); while ((line = in.readLine()) != null) { content.append(line); }

Getting null as response from Stack Overflow API with PHP

帅比萌擦擦* 提交于 2019-12-21 05:22:00
问题 I use this code for PHP to get Stack Overflow reputation. $feed = json_decode(file_get_contents("http://api.stackexchange.com/2.1/users/22656?order=desc&sort=reputation&site=stackoverflow&filter=!*MxOyD8qN0Yghnep", true), true); $array = $feed['items'][0]; $rep = $array['reputation']; echo $rep; But I get null for feed. Also user account is Jon Skeet which is where I get the ID 22656. How can I fix this? 回答1: The problem is that the response is also gzipped. My preferred fix would be to use

How to retrieve number of tags at a certain time in the past

我的未来我决定 提交于 2019-12-14 03:25:11
问题 I can see here how to get number of tags through StackExchange API. Is it possible to get number of tags at a certain time in the past? How can I run https://api.stackexchange.com/2.2/tags?order=desc&sort=popular&inname=java&site=stackoverflow with BigQuery? 回答1: One of potentially many options - for BigQuery Standard SQL #standardSQL SELECT tag, COUNT(1) AS popular FROM `bigquery-public-data.stackoverflow.stackoverflow_posts`, UNNEST(SPLIT(tags, '|')) AS tag WHERE DATE(creation_date) BETWEEN

How to download code using TortoiseHg (Mercurial)

荒凉一梦 提交于 2019-12-13 14:28:05
问题 I am trying to download the code theworldsworststackoverflowclone. At first I have tried with Tortoise SVN but later get to know that hg command is not supported. Now I downloaded Mrcurial and TortoiseHg 2.0.2 with Mercurial 1.8.1 - x64 Windows and installed on my system. I have also tweaked the proxy settings required. But whenever I am trying to clone , then I am getting the following error: Clone not found [Command returned Code 225] 回答1: It worked for me. I'm using TortoiseHg (1.1.5) and

How to adjust the number of results returned when querying the Stackoverflow API?

陌路散爱 提交于 2019-12-13 14:18:18
问题 I'm using the Stackoverflow JSON API to retrieve questions marked with a given tag. I have this small program in Java which retrieves questions marked with the "Java" tag. public static void main(String[] args) throws Exception { String urlString = "https://api.stackexchange.com/2.1/questions?order=desc&sort=votes&tagged=java&site=stackoverflow"; URL url = new URL( urlString ); BufferedReader reader = null; StringBuffer buffer = new StringBuffer(); try { URLConnection connection = url

Py-StackExchange filter by tag

青春壹個敷衍的年華 提交于 2019-12-12 07:20:07
问题 I'm using Py-StackExchange to get a list of recent questions from Stack Overflow. I know there is a way to get just a constant list of questions: import stackexchange so = stackexchange.Site(stackexchange.StackOverflow) for question in so.questions(pagesize=10): print question But this returns all questions across SO. I'm wondering if there is a parameter to filter the questions list by tag, i.e. python , loops , etc to only return questions in that tag. I've been cruising the web for almost

Get the date/time a badge was awarded?

泄露秘密 提交于 2019-12-11 18:25:23
问题 Using this, it is possible to take the badges from a specific user of Stack Overflow: library(stackr) badges <- stack_users(9371451, "badges", num_pages=100000, pagesize=100) How can I add a parameter to take also the timestamp that the badge was awarded to the user? And if possible, for which answer? 回答1: It is possible- ish with the Stack Exchange API, but not with the stackr library you are using. The /users/{ids}/badges route returns a list of badge objects, which only has these possible

How to reduce query time for stackexchange api?

a 夏天 提交于 2019-12-11 04:16:29
问题 I try to collect for a list of users the questions. So I prepared this command lines: library(stackr) dft <- data.frame() for (j in 1:nrow(df)) { questions <- stack_users(df$userid[j], "questions", num_pages=1000000, pagesize=100, filter="withbody") for (s in 1:nrow(questions)){ dft <- rbind(dft, data.frame( tags = ifelse(is.null(questions$tags[s]) , NA, questions$tags[s]), is_answered = ifelse(is.null(questions$is_answered[s]) , NA, questions$is_answered[s]), view_count = ifelse(is.null