我正在開發一個Rails 3應用程序,我希望能夠從維基百科中提取有關任何主題的數據(標題和簡短文本)。從維基百科提取數據儘可能乾淨使用Rails 3
我需要獲得信息非常「乾淨」換句話說,免費的HTML,Wikitags和無關的數據,如引用列表等。
是否有可能得到僅關於該主題的標題和一些文本?
我正在使用gem來獲取數據,但它非常難看。
{{for|the television series|Solsidan (TV series)}} {{Infobox settlement |official_name = Solsidan |image_skyline = |image_caption = |pushpin_map = Sweden |pushpin_label_position = |coordinates_region = SE |subdivision_type = [[Country]] |subdivision_name = [[Sweden]] |subdivision_type3 = [[Municipalities of Sweden|Municipality]] |subdivision_name3 = [[Nacka Municipality]] |subdivision_type2 = [[Counties of Sweden|County]] |subdivision_name2 = [[Stockholm County]] |subdivision_type1 = [[Provinces of Sweden|Province]] |subdivision_name1 = [[Uppland]] |area_footnotes = {{cite web | title=Tätorternas landareal, folkmängd och invånare per km2 2000 och 2005 | publisher=[[Statistics Sweden]] | url=http://www.scb.se/statistik/MI/MI0810/2005A01B/T%c3%a4torternami0810tab1.xls | format=xls | language=Swedish | accessdate=2009-05-08}} |area_total_km2 = 0.23 |population_as_of = 2005-12-31 |population_footnotes = |population_total = 209 |population_density_km2 = 895 |timezone = [[Central European Time|CET]] |utc_offset = +1 |timezone_DST = [[Central European Summer Time|CEST]] |utc_offset_DST = +2 |coordinates_display = display=inline,title |latd=59 |latm=17 |lats= |latNS=N |longd=17 |longm=51 |longs= |longEW=E |website = }} '''Solsidan''' is a [[Urban areas in Sweden|locality]] situated in [[Nacka Municipality]], [[Stockholm County]], [[Sweden]] == References == {{Reflist}} {{Stockholm-geo-stub}} {{Localities in Nacka Municipality}} [[Category:Populated places in Stockholm County]] [[no:Solsidan]] [[sv:Solsidan, Nacka kommun]]
我需要使用他們的API,而不是我自己的主機。 – 2011-02-23 15:38:33