2013-11-22 27 views
-1

首先。我怎樣才能編輯這個呈現的CSS? http://en.wikipedia.org/w/index.php?title=Albert_Einstein&action=render如何僅從維基媒體API獲取文本?以及如何編輯CSS?

二 我擁有電子鏈接http://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=Stack%20Overflow

結果:

{"query":{"pages":{"21721040":{"pageid":21721040,"ns":0,"title":"Stack Overflow","extract":"<p><b>Stack Overflow</b> is a website, the flagship site of the Stack Exchange Network, created in 2008 by Jeff Atwood and Joel Spolsky, as a more open alternative to earlier Q&amp;A sites such as Experts Exchange. The name for the website was chosen by voting in April 2008 by readers of <i>Coding Horror</i>, Atwood's popular programming blog.</p>\n<p>It features questions and answers on a wide range of topics in computer programming. The website serves as a platform for users to ask and answer questions, and, through membership and active participation, to vote questions and answers up or down and edit questions and answers in a fashion similar to a wiki or digg. Users of Stack Overflow can earn reputation points and \"badges\"; for example, a person is awarded 10 reputation points for receiving an \"up\" vote on an answer given to a question, and can receive badges for their valued contributions, which represents a kind of gamification of the traditional Q&amp;A site or forum. All user-generated content is licensed under a Creative Commons Attribute-ShareAlike license.</p>\n<p>As of August 2013<sup class=\"plainlinks noprint asof-tag update\" style=\"display:none;\">[update]</sup>, Stack Overflow has over 1,900,000 registered users and more than 5,500,000 questions. Based on the type of tags assigned to questions, the top eight most discussed topics on the site are: C#, Java, PHP, JavaScript, Android, jQuery, C++ and Python.</p>\n<p></p>"}}}} 

我怎麼可以給沒有這個和其他charachters?

{"query":{"pages":{"21721040":{"pageid":21721040,"ns":0,"title":"Stack Overflow","extract":" 

回答

0

你得到的東西是一個JSON對象。我不太確定你是如何使用這些數據的,但是你應該解析這個JSON並且只得到那個對你很重要的部分:extract屬性。

+0

嗨。感謝您的回答。我只想得到我的Drupal站點的摘要。我可以得到文本,但有一些代碼{「查詢」:等等......如何清楚地得到摘要文本?我在Wikipedia Api Sandbox上嘗試了一些組合,但是我不能沒有{「查詢...... –

相關問題