问题标签 [stackexchange-api]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - 具有 Stack Exchange 基本信息的投资组合
我目前想开发一个网页来显示我在 Stack Exchange 中的成就。
只是基本信息......获得的徽章和声誉。
我是 Javascript 的初学者。我简要回顾了 Javascript SDK,但似乎无法通过介绍。显然,要访问信息,我需要一个访问令牌来加载“/我”网址。
这是 api 的链接:https ://api.stackexchange.com/docs/js-lib
我对此采取了正确的方法吗?我需要加载的只是获得的声誉和徽章。并在每次刷新页面时重新加载这些值。
stackexchange-api - How to retrieve stackoverflow tag usage count via stackexchange api call?
I want to retrieve the 'tag usage count' of a language like Ruby or Java via the StackExchange API.
Basically I want to retrieve these numbers via API call: https://stackoverflow.com/tags
e.g. how do I get the 780k for Java as seen in the link via StackExchange API call?
Does anyone know?
I tried this: https://api.stackexchange.com/2.2/search/advanced?order=desc&sort=activity&tagged=java&site=stackoverflow
but that doesn't give me the total count
It seems to be easy with the Stack Exchange Data Explorer https://data.stackexchange.com/stackoverflow/query/229727
But how to retrieve these counts via API?
stackexchange-api - 从 stackexchange api 获取标签的流行度?
如何从stackexchange api获取 stackoverflow 标签流行历史?
目前我获得了特定时间段内的标签总数,但我必须为每个时间段执行一个新的 http 调用。我在文档中进行了搜索,但没有找到执行此操作的方法。
我想获得一系列带有特定标签的总问题,这些问题按一段时间(月/周/日)分页。
我目前拥有的
请求网址
回复
{“总数”:785846}
我想要的是
回复
(这是我的小项目: http: //fredericlefeurmou.github.io/stack-overlow-analytics)
json - 如何根据搜索查询从 stackoverflow API 获取问题列表?
我有兴趣根据标签或搜索查询获取问题列表。我会给你一个例子。
因此,如果我使用搜索关键字作为“ipv4”,它应该会给我一个与 ipv4 相关的问题的大列表。我要做的就是将问题(标题)作为列表或数组获取,以便我可以对其进行一些处理。
c# - 向 StackExchange Api 发出请求
我正在尝试通过url以 JSON 格式请求 StackExchange 上的标签列表,但问题是,我得到了一些损坏的文本而不是 JSON,所以我什至无法解析它。
PS在 RestSharp 的帮助下完成。
php - 从stackoverflow的api响应中提取键值对以使用php将它们保存在mysql中
如何使用php从stackoverflow API的响应中提取键值对?
键是名称和计数
下面给出了获取响应的链接
响应为
{"items":[{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":835623,"name":"java"},{"has_synonyms":true,"is_moderator_only" :false,"is_required":false,"count":826692,"name":"javascript"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":780233," name":"c#"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":733762,"name":"php"},{"has_synonyms":true," is_moderator_only":false,"is_required":false,"count":656491,"name":"android"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":600666,"name":"jquery"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":411780 ,"name":"python"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":402876,"name":"html"},{"has_synonyms":true ,"is_moderator_only":false,"is_required":false,"count":361469,"name":"c++"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count" :324702,"name":"ios"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":314826,"name":"mysql"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":296359,"name":"css"},{" has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":271375,"name":"sql"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false ,"count":253038,"name":"asp.net"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":224602,"name":"objective- c"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":207451,"name":".net"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":202666,"name":"iphone"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false ,"count":200238,"name":"ruby-on-rails"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":176868,"name":" c"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":130813,"name":"ruby"},{"has_synonyms":true,"is_moderator_only":false ,"is_required":false,"count":129764,"name":"arrays"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":127562,"name":"sql-server"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":116079,"name ":"ajax"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":114163,"name":"regex"},{"has_synonyms":false,"is_moderator_only ":false,"is_required":false,"count":112127,"name":"xml"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":111066, "名称":"json"},{"has_synonyms":true,"is_moderator_only":false,"is_required":false,"count":107333,"name":"asp.net-mvc"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":99944,"name":"wpf"},{"has_synonyms" :false,"is_moderator_only":false,"is_required":false,"count":98195,"name":"linux"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false," count":93114,"name":"django"}],"has_more":true,"quota_max":300,"quota_remaining":228}is_required":false,"count":98195,"name":"linux"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":93114,"name":" django"}],"has_more":true,"quota_max":300,"quota_remaining":228}is_required":false,"count":98195,"name":"linux"},{"has_synonyms":false,"is_moderator_only":false,"is_required":false,"count":93114,"name":" django"}],"has_more":true,"quota_max":300,"quota_remaining":228}
我已经这样做了,但在 php 中没有响应
我也使用 javascript 完成了此操作,我得到了响应,但是 javascript 无法与数据库交互。我尝试从那里将其发送到 php 文件,但我无法从请求中获取键值对。
我也尝试过 php 函数 file_get_contents([URL])
代码如下
我收到错误
1.file_get_contents(): php_network_getaddresses: getaddrinfo failed: No such host is known
2.file_get_contents(https://api.stackexchange.com/2.2/tags?order=desc&sort=popular&site=stackoverflow):无法打开流:php_network_getaddresses:getaddrinfo 失败:不知道这样的主机
android - Android JSON空对象引用错误
我在我的应用程序中使用 StackExchange API,它返回如下响应:
我正在使用以下代码从 URL 获取字符串:
我正在使用异步任务在文本视图中显示问题,如下所示:
但我收到一个错误消息
“尝试在空对象引用上调用虚拟方法 'org.json.JSONObject org.json.JSONArray.getJSONObject(int)'”
在这些线上:
和
我该如何解决?另外,如何从这个 JSON 响应中的“所有者”对象访问“显示名称”?
谢谢
android - 堆栈交换 api post 方法
我正在尝试upvote
使用stackexchange
android 中的 API 提出问题。使用 URL
https://api.stackexchange.com/2.2/questions/{questionID}/upvote
但在日志中它只是显示类似 org.apache.http.message.BasicHttpResponse@33b2c539
支持问题的 API 链接是 https://api.stackexchange.com/docs/upvote-question
当我从 API 链接尝试它的工作时,但不是使用代码。
在下面的代码中找到:
字符串 url="https://api.stackexchange.com/2.2/questions/"+questionId+"/upvote";
stackexchange-api - 通过 /questions 仅从 Stack Exchange api 获取已解决的问题?
我只想从/questions
Stack Exchange API 获得封闭的问题。
我已经对过滤器进行了一些尝试,并且我想出了一些东西,可以为每个问题提供一些这样的 JSON:
现在,我只想要已关闭的问题。
我怎样才能做到这一点 ?
(另一件事:我如何从结果中排除封闭的问题?)
php - 如何在 PHP 中使用 StackOverflow API V 2.2 获取问题
我正在做一个项目,想使用 Stack Overflow API 从堆栈溢出中获取问题。我在这里搜索了如何实现相同的方法:
- 如何根据搜索查询从stackoverflow API获取问题列表?
- 使用 PHP 从 Stack Overflow API 获取 null 作为响应
- 如何在 PHP 中使用 Stack Overflow API
但我发现没有什么有用的,因为它们是旧技术。他们正在使用旧的 Stack Overflow API 版本。
在浏览 stackapps 时,我读到要完成这项任务,我必须注册我的应用程序。我已经在 www.stackapps.com 上注册了一个应用程序。我得到了一个 APP ID 和它的 SECRET KEY。
我访问了这里https://api.stackexchange.com/docs/authentication以了解如何从堆栈 API V 2.2 获取数据。他们提供了有用的链接,以使用 Stack Overflow API V 2.0 通过 OAuth 2.0 进行身份验证来获取数据
它说要求用户提出请求,然后获取“代码”等。我被困在这里。为了继续使用 PHP,应该是什么过程。
我的应用程序应该这样做:
让输入链接为:https ://api.stackexchange.com/2.2/questions?order=desc&sort=activity&site=stackoverflow
我以 HTML 或 JSON 两种形式中的任何一种形式获取此页面的数据。
可以在没有 OAuth 的情况下完成吗?如果没有,请指导。