问题标签 [wikipedia]

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.

0 投票
4 回答
3081 浏览

programming-languages - 维基百科是用什么语言编写的?

维基百科是用什么语言编写的?

0 投票
1 回答
2208 浏览

java - 按主题搜索并从维基百科的文章中提取关键字

我正在用 java 做一个项目,我必须在其中处理一个维基百科转储文件。我正在寻找一个库来提取维基百科文章中的关键字......基本上我想阅读维基百科 xml 转储中的每个标签页,并将其与主题和类别列表进行比较,如果正确,选择它并添加我的结果。我对阅读转储或编写维基百科结果不感兴趣,只是我想知道任何能让我在维基百科文章的标题和文本中按主题搜索的库......例如......如果输入是“狗”我想要关于狗的维基百科文章,如果可能的话,狗类别下的任何页面。

是否为通用目的而不是为维基百科指定库并不重要。我需要将 wikitext 作为参数并收到一个关键字列表,包括类别...我发现了一些运行良好的维基百科库,例如Wikipedia-MinerJava Wikipedia Library,但首先我需要安装 mysql 和我想分析文本而不将其保存到数据库中。

任何形式的帮助或建议都会受到欢迎。:)

0 投票
1 回答
2206 浏览

web-services - 安装MediaWiki后如何制作模板?

我刚刚安装了 MediaWiki。我必须做什么才能拥有这样的维基百科样式模板:http: //i.piccy.info/i4/4b/37/fe303fda0c813c0bda717d3a1e3b.png(示例)。我已经在我的 MediaWiki CMS 上安装了 ParserFunctions Extension。我试图查看源代码并复制它,但它没有用。谢谢。

**对不起我的英语(这不是我的母语)*

0 投票
6 回答
2757 浏览

api - Reverse wikipedia geotagging lookup

Wikipedia is geotagging a lot of its articles. (Look in the top right corner of the page.)

Is there any API for querying all geotagged pages within a specified radius of a geographical position?

Update

Okay, so based on lost-theory's answer I tried this (on DBpedia query explorer):

This is very close to what I want, except it returns results within a (local) square around the point and not a circle. Also I would like if the results where sorted based on the distance from the point. (If possible.)

Update 2

I am trying to determine the euclidean distance as an approximation of the true distance, But I am having trouble on squaring a number in SPARQL. (Question opened here.) When I get something useful I will update the question, but in the meantime I will appreciate any suggestions on alternative approaches.

Update 3

A final update. I gave up on using SPARQL through DBpedia. I have written a simple parser which fetches the Wikipedia article text nightly database dump and parses all articles for geocodes. It works rather nicely and it allows me to store information about geotagged articles however I wish.

This is probably the solution I will continue using, and if I get around to create a nice interface to it I might consider allowing public API access and/or publishing the source to the parser.

0 投票
2 回答
536 浏览

wikipedia - 维基百科机器人和验证码

我看到有许多用于编写维基百科机器人的php(和其他)框架,但验证码不是问题吗?或者机器人不必解决它(但这听起来好像一开始就没有验证码......)?或者也许我可以让我的 prog 停止并让我填写验证码?

0 投票
2 回答
1490 浏览

css - 如何更改 wiki 页面上水平线的颜色?

在 wiki 中,您只需在输入的文本中添加“----”即可添加水平线。我只是找不到控制它的 CSS 部分。(不,这不是“小时”)

0 投票
1 回答
1958 浏览

c# - 如何访问维基百科

我想从维基百科访问 HTML 内容。但它显示访问被拒绝。

我如何访问 Wiki。请给点建议

0 投票
9 回答
14901 浏览

parsing - 获取维基百科文章的第一行

我有一篇 Wikipedia-Article,我想从文章中获取前 z 行(或前 x 字符或前 y 字,无关紧要)。

问题:我可以获取源 Wiki-Text(通过 API)或解析的 HTML(通过直接 HTTP 请求,最终在打印版本上),但我怎样才能找到显示的第一行?通常,源代码(html 和 wikitext)以信息框和图像开头,而要显示的第一个真实文本位于代码中的某个位置。

例如: 维基百科上的阿尔伯特·爱因斯坦(印刷版)。查看代码,第一个真实文本行“Albert Einstein(发音为 /ˈælbərt ˈaɪnstaɪn/;德语:[ˈalbɐt ˈaɪ̯nʃtaɪ̯n];1879 年 3 月 14 日至 1955 年 4 月 18 日)是一位理论物理学家。” 不是在开始。这同样适用于Wiki-Source,它以相同的信息框开头,依此类推。

那么你将如何完成这项任务呢?编程语言是java,但这无关紧要。

我想到的一个解决方案是使用 xpath 查询,但这个查询对于处理所有边界情况会相当复杂。[更新]没那么复杂,看下面我的解决方案![/update]

谢谢!

0 投票
2 回答
104 浏览

multithreading - 当多线程仍然是现代 CPU 上的一个问题时,是否部分更新了值?

来自关于 Read-Copy-Update 的维基百科文章

与读取器同时运行删除阶段是安全的原因是现代 CPU 的语义保证读取器将看到数据结构的旧版本或新版本,而不是部分更新的引用。

这适用于所有现代 CPU(ARM、x86、PPC 等)吗?未来有可能改变吗?只要您不介意可能再次获得旧值,就永远不需要支付锁定加载的成本似乎非常好(这对于许多应用程序来说可能不是问题——基本上对于任何可以使用的应用程序来说)读取-复制-更新)。

0 投票
2 回答
376 浏览

mysql - 截断媒体维基

我正在使用 mediawiki API(例如http://en.wikipedia.org/w/api.php),我希望能够“截断”mysql表,以便在保留一些的同时重置本地安装表(用户,?...)。SQL 查询是什么?

我会说: tuncate 除了 ${PREFIX}_user 和更新 ${PREFIX}_user set user_editcount=0 之外的所有表?

还有其他(更安全)的建议吗?