Ezhil-Lang
Ezhil-Lang copied to clipboard
எழில் எ.கா: rss feed reader தமிழ் விக்கிபீடியா
எழில் எ.கா: rss feed reader ஒன்றை எழில் வழியாக உருவாக்கி தமிழ் விக்கிபீடியாவில்
கடைசியாக, சமிபத்தில்,
- எந்த கட்டுரை எழுத பட்டது ?
- எந்த கட்டுரை திருத்த பட்டது ?
வணக்கம், இந்த செயலை செய்வதற்கு இதற்கான API கள் வேண்டுமே அவை எழில் மொழியில் உள்ளதா.
mediawiki provides api to get recent changes
https://www.mediawiki.org/wiki/API:RecentChanges
https://www.mediawiki.org/wiki/API:Recent_changes_stream
We can use those api with python easily.
Nice suggestion, Srini!
My simple code in Python using the above API's looks like,
# This file is part of Ezhil Language Project
import json
import urllib
from sys import version
PYTHON3 = version[0] == '3'
if PYTHON3:
import urllib.request, urllib.parse, urllib.error
print(version)
wikipedia_url = u"https://en.wikipedia.org/w/api.php?action=query&format=json&list=recentchanges&rcprop=title%7Cids%7Csizes%7Cflags%7Cuser&rclimit=3"
if PYTHON3:
conn = urllib.request.urlopen(wikipedia_url)
else:
conn = urllib.urlopen(wikipedia_url)
data = json.loads(conn.read().decode("utf-8"))
changed_articles = data['query']['recentchanges']
for changed in changed_articles:
article = changed['title']
user = changed['user']
print(u"Article '%s' was edited by %s."%(article,user))
@gkarunakaran - you can use the JSON api commited to the Ezhil as part of issue #187