Is there anyway to get access to stackoverflow's awesome tagging system? I would like to borrow Stack's awesome auto-suggest and tag mini-explanation boxes for my own site. Obviously, I can use the jQuery UI auto-suggest for tags but I would really like to also include the cool little tag descriptions as well. If not, can someone tell me where all these explanation/descriptions came from so that I can implement a similar system?

反正有没有访问stackoverflow的真棒标记系统?我想借用Stack为我自己的网站提供的真棒自动建议和标签迷你解释盒。显然,我可以使用jQuery UI自动建议标签,但我真的想也包括很酷的小标签描述。如果没有,有人可以告诉我所有这些解释/描述来自哪里,以便我可以实现类似的系统?

2 个解决方案

#1


15

tageditornew.js

tageditornew.js

Line 308:

308行:

$.get("/filter/tags", {q: a,newstyle: !0}, "json").done(function(c) {
    C["t_" + a] = c;
    StackExchange.helpers.removeSpinner();
    b(c)
})

This might help you out!

这可能会帮到你!


It turns out that,

the API url is this:

API网址是这样的:

https://stackoverflow.com/filter/tags?q=STRING&newstyle=BOOLEAN
  • q - Query text.
  • q - 查询文本。
  • newstyle - Require new style or not. Result in new style will be returned in JSON with additional information such as synonyms and excerpt.
  • newstyle - 需要新风格。将使用其他信息(如同义词和摘录)以JSON格式返回新样式的结果。

DEMO: http://jsfiddle.net/DerekL/bXXb7/ (with Cross Domain Requests jQuery plguin)

演示:http://jsfiddle.net/DerekL/bXXb7/(跨域请求jQuery plguin)

For example:

例如:

https://stackoverflow.com/filter/tags?q=htm

would give you:

会给你:

"html|99829\nhtml5|16359\nxhtml|4143\nhtml-parsing|1461\nhtml-lists|1328\nhtml5-video|949"

where 99829 is the amount of questions. It took me 15 minutes looking at the source code to find out this api. -_-"

其中99829是问题的数量。我花了15分钟查看源代码来找出这个api。 -_-”

Putting in javascript in new style gives you this: here

在新风格中加入javascript会给你:这里

[{"Name":"javascript","Synonyms":"classic-javascript|javascript-execution","Count":223223,"Excerpt":"JavaScript is a dynamic language commonly used for scripting in web browsers. It is NOT the same as Java. Use this tag for questions regarding ECMAScript and its dialects/implementations (excluding ActionScript and JScript). If a framework or library, such as jQuery, is used, include that tag as well. Questions that don't include a framework/library tag, such as jQuery, implies that the question requires a pure JavaScript answer."},{"Name":"javascript-events","Synonyms":"javascript-event","Count":5707,"Excerpt":"Creating and handling JavaScript events inline in HTML or through a script."},{"Name":"facebook-javascript-sdk","Synonyms":"","Count":992,"Excerpt":"Facebook's JavaScript SDK provides a rich set of client-side functionality for accessing Facebook's server-side API calls. These include all of the features of the REST API, Graph API, and Dialogs."},{"Name":"javascript-library","Synonyms":"","Count":675,"Excerpt":"A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies."},{"Name":"javascript-framework","Synonyms":"","Count":563,"Excerpt":"A JavaScript framework is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies."},{"Name":"unobtrusive-javascript","Synonyms":"","Count":340,"Excerpt":"Unobtrusive JavaScript is a general approach to the use of JavaScript in web pages."}]

[{“Name”:“javascript”,“Synonyms”:“classic-javascript | javascript-execution”,“Count”:223223,“Excerpt”:“JavaScript是一种动态语言,通常用于Web浏览器中的脚本。它是与Java不同。将此标记用于有关ECMAScript及其方言/实现的问题(不包括ActionScript和JScript)。如果使用框架或库(如jQuery),请同时包含该标记。不包括的问题框架/库标签,例如jQuery,暗示该问题需要纯JavaScript答案。“},{”Name“:”javascript-events“,”Synonyms“:”javascript-event“,”Count“:5707, “摘录”:“在HTML中或通过脚本内联创建和处理JavaScript事件。”},{“名称”:“facebook-javascript-sdk”,“同义词”:“”,“计数”:992,“摘录” :“Facebook的JavaScript SDK提供了一组丰富的客户端功能,用于访问Facebook的服务器端API调用。这些功能包括REST API,图谱API和对话框的所有功能。”},{“名称”:“javascript -library “” SY nonyms“:”“,”Count“:675,”摘录“:”JavaScript库是一个预编写的JavaScript库,可以更轻松地开发基于JavaScript的应用程序,特别是对于AJAX和其他以Web为中心的技术。“ },{“Name”:“javascript-framework”,“Synonyms”:“”,“Count”:563,“摘录”:“JavaScript框架是一个预先编写的JavaScript库,可以更轻松地开发JavaScript-基于应用程序,特别是对于AJAX和其他以Web为中心的技术。“},{”Name“:”unobtrusive-javascript“,”Synonyms“:”“,”Count“:340,”摘录“:”不引人注目的JavaScript是一般的在网页中使用JavaScript的方法。“}]

What you can get from there:

你可以从那里得到什么:

  • All tags start with javascript
  • 所有标签都以javascript开头
  • Synonyms
  • 同义词
  • Tag counts
  • 标记计数
  • Nice tag descriptions
  • 好的标签说明

更多相关文章

  1. HTML5绘图之Canvas标签 绘制坐标轴
  2. 如何在execCommand formatBlock 'p'标签中添加类或id或CSS样式?
  3. script标签写在哪里好?
  4. 从动态生成的音频标签中收听audio.ended
  5. 点击a标签,返回上一页
  6. JS实现60s倒计时(亲测有效),及span标签如何使用和禁用onclick事件
  7. FusionCharts的Line.swf做法,我想出现2条图形线,怎么设置graph标签
  8. 如何在chart.js中为饼图添加标签
  9. 将鼠标悬停在matplotlib中的某个点上时,是否可以显示标签?

随机推荐

  1. MySQL中的排序(ORDER BY)
  2. 根据cookie数据连接两个表
  3. sqlsever 转mysql 出错 MySQL max_allowe
  4. 在表中垂直显示数据库中的数据
  5. 将mysql查询结果转换为CSV(带有复制/粘贴
  6. 使用MySQL正则表达式 __MySQL必知必会
  7. Mysql存储过程创建失败,版本5.5,请高手解决
  8. MySql日志与事务的隔离级别
  9. 在Win2003+Tomcat+MySQL下运行JPetStore
  10. 【20110115 InfoQ 百度技术沙龙 2010 第