Ezhil-Language-Foundation / Ezhil-Lang

எழில் - ஒரு தமிழ் நிரலாக்க மொழி; தமிழ் மாணவர்களுக்கு இது முதல்முறை கணிப்பொறி நிரல் ஏழுத உதவும் (Ezhil, is a fun Tamil programming language for K-12).
http://ezhillang.org/
GNU General Public License v3.0
169 stars 46 forks source link

எழில் எ.கா: rss feed reader தமிழ் விக்கிபீடியா #153

Open arcturusannamalai opened 8 years ago

arcturusannamalai commented 8 years ago

எழில் எ.கா: rss feed reader ஒன்றை எழில் வழியாக உருவாக்கி தமிழ் விக்கிபீடியாவில்

கடைசியாக, சமிபத்தில்,

  1. எந்த கட்டுரை எழுத பட்டது ?
  2. எந்த கட்டுரை திருத்த பட்டது ?
agkarun commented 7 years ago

வணக்கம், இந்த செயலை செய்வதற்கு இதற்கான API கள் வேண்டுமே அவை எழில் மொழியில் உள்ளதா.

tshrinivasan commented 7 years ago

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.

arcturusannamalai commented 7 years ago

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))
arcturusannamalai commented 7 years ago

@gkarunakaran - you can use the JSON api commited to the Ezhil as part of issue #187