2013-11-22 7 views
-1

먼저. 이 렌더링을 CSS로 어떻게 편집 할 수 있습니까? 둘째 http://en.wikipedia.org/w/index.php?title=Albert_Einstein&action=renderWikimedia 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 사이트에 요약 만 보내고 싶습니다. 나는 텍스트를 얻을 수 있지만 몇 가지 코드가있다. { "query": and etc ... 어떻게 요약 텍스트를 명확하게 얻는가? 나는 Wikipedia Api Sandbox에서 어떤 조합을 시도했지만 { "query ... –