Hello
http://en.wiktionary.org/w/api.php?format=json&action=query&titles=m...
yields json contents for the word 'murky'.
content = json_returned_content. content
{"query":{"pages":{"54377":{"pageid":54377,"ns":0,"title":"murky","revisions":[{"*":"==English==\n\n===Etymology===\nCognate to or directly from {{etyl|non}} {{term|myrkr}}. Compare Russian, Serbian [[\u043c\u0440\u0430\u043a]].\n\n===Pronunciation===\n* {{audio|en-us-murky.ogg|Audio (US)}}\n\n* {{rhymes|\u025c\u02d0(r)ki}}\n\n===Adjective===\n{{en-adj|murkier|murkiest}}\n\n# Hard to see through, as a fog or mist.\n# [[gloomy|Gloomy]], [[dark]], [[dim]].\n# [[obscure|Obscure]], [[indistinct]], [[cloudy]].\n# Dishonest, [[shady]].\n\n====Synonyms====\n* [[dark]]\n\n====Related terms====\n* [[murk]]\n* [[murkily]]\n* [[murkiness]]\n\n====Translations====\n{{trans-top|hard to see through}}\n* Dutch: [[troebel]], [[troebele]]\n* Finnish: {{t+|fi|samea}}\n* French: {{t+|fr|sombre}}, {{t+|fr|trouble}}\n* German: {{t+|de|d\u00fcster}}, {{t+|de|tr\u00fcb}}\n{{trans-mid}}\n* Romanian: {{t-|ro|tulbure}}\n* Russian: {{t|ru|\u043c\u0443\u0442\u043d\u044b\u0439|tr=m\u00fatnyj}}\n* [[Scots]]: {{t\u00f8|sco|mirk|xs=Scots}}\n{{trans-bottom}}\n{{trans-see|gloomy}}\n{{trans-see|obscure}}\n{{trans-top|dishonest, shady}}\n* Russian: {{t+|ru|\u0442\u0451\u043c\u043d\u044b\u0439|tr=t'\u00f3mnyj}}, {{t+|ru|\u0433\u0440\u044f\u0437\u043d\u044b\u0439|tr=gr'\u00e1znyj}}\n{{trans-mid}}\n{{trans-bottom}}\n{{checktrans-top}}\n* {{ttbc|da}}: {{t-|da|m\u00f8rk}}, {{t-|da|dunkel}}, {{t-|da|dyster}}\n* {{ttbc|he}}: [[\u05e2\u05db\u05d5\u05e8, \u05de\u05d8\u05d5\u05e9\u05d8\u05e9]]\n{{trans-mid}}\n* {{ttbc|is}}: [[myrkr]]\n{{trans-bottom}}\n\n====External links====\n* {{R:Webster 1913}}\n* {{R:Century 1911}}\n\n[[et:murky]]\n[[io:murky]]\n[[kn:murky]]\n[[lt:murky]]\n[[hu:murky]]\n[[mg:murky]]\n[[ml:murky]]\n[[my:murky]]\n[[pl:murky]]\n[[ru:murky]]\n[[fi:murky]]\n[[sv:murky]]\n[[ta:murky]]\n[[te:murky]]\n[[vi:murky]]\n[[zh:murky]]"}]}}}}
content['query']['pages']['54377']['revisions][0]['*'] yields meaning and other related contents.
I am interested to retrieve the meaning of the word. how can I do it?
In this scenario I find api to be unusable since pageid is dynamically generated which is required to access the contents.
Yes I can use xml and find contents inside <rev></rev> tag, but how will some one fetch synonym alone and part of speech alone?
On Sat, Dec 31, 2011 at 5:53 PM, kracekumar ramaraju kracethekingmaker@gmail.com wrote:
http://en.wiktionary.org/w/api.php?format=json&action=query&titles=m...
yields json contents for the word 'murky'.
[snip]
content['query']['pages']['54377']['revisions][0]['*'] yields meaning and other related contents.
I am interested to retrieve the meaning of the word. how can I do it?
In this scenario I find api to be unusable since pageid is dynamically generated which is required to access the contents.
If you pass the &indexpageids=1 parameter, the API will output an array containing the page IDs used in the response. http://en.wiktionary.org/w/api.php?format=json&action=query&titles=m...
Yes I can use xml and find contents inside <rev></rev> tag, but how will some one fetch synonym alone and part of speech alone?
The API does not provide a way to get just the IPA pronunciation, or just the synonyms, or fetch any other semantic information. The only thing that is offered is separation into sections using ==Headers== , for anything else you'll have to extract the information yourself AFAIK.
Roan
Hi
kracethekingmaker@gmail.com wrote:
http://en.wiktionary.org/w/api.php?format=json&action=query&titles=m...
yields json contents for the word 'murky'.
[snip]
content['query']['pages']['54377']['revisions][0]['*'] yields meaning and other related contents.
I am interested to retrieve the meaning of the word. how can I do it?
In this scenario I find api to be unusable since pageid is dynamically generated which is required to access the contents.
If you pass the &indexpageids=1 parameter, the API will output an array containing the page IDs used in the response.
http://en.wiktionary.org/w/api.php?format=json&action=query&titles=m...
Thanks .
Yes I can use xml and find contents inside <rev></rev> tag, but how will some one fetch synonym alone and part of speech alone?
The API does not provide a way to get just the IPA pronunciation, or just the synonyms, or fetch any other semantic information. The only thing that is offered is separation into sections using ==Headers== , for anything else you'll have to extract the information yourself AFAIK.
Instead of separating contents with ==Headers== it will be freaking
awesome if it is returned as array, This makes easy for end users. Else I need to write my own parser.
Roan
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
On 31/12/11 18:08, kracekumar ramaraju wrote:
The API does not provide a way to get just the IPA pronunciation, or just the synonyms, or fetch any other semantic information. The only thing that is offered is separation into sections using ==Headers== , for anything else you'll have to extract the information yourself AFAIK.
Instead of separating contents with ==Headers== it will be freaking awesome if it is returned as array, This makes easy for end users. Else I need to write my own parser.
The API is content-agnostic. A wiki could contain the IPA pronunciation inside {{IPA|...}}, another could mark the definition with <font color="green"> </font> and most wouldn't even contain IPA not definitions (eg. it could be granny's blog).
That means that usually, you need to make your wiki-specific parser to fetch the pieces relevant for you.
mediawiki-api@lists.wikimedia.org