Skip to content

Instantly share code, notes, and snippets.

@vssun
Created February 28, 2012 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vssun/1933393 to your computer and use it in GitHub Desktop.
Save vssun/1933393 to your computer and use it in GitHub Desktop.
തലക്കെട്ടിൽ തിരഞ്ഞ് താളുകളെ കണ്ടെത്താൻ
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
തലക്കെട്ടിൽ തിരഞ്ഞ് താളുകളെ കണ്ടെത്താൻ
നിർമ്മിച്ചത്: സുനിൽ വി.എസ്., സരയുവിനൊപ്പം
തിയതി: 2012-02-27
"""
import wikipedia
import pagegenerators
#പ്രധാന പ്രോഗ്രാം ഇവിടെ തുടങ്ങുന്നു.
#ആവശ്യത്തിനനുസരിച്ച് മാറ്റങ്ങൾ ഇതിനു താഴെ വരുത്തുക
siteFamily = 'wiktionary'
siteLangCode = 'ml'
startPage = u'അ'
checkString = u'‍' #ZWJ
outputPage = 'user:vssun/test'
#ആവശ്യത്തിനനുസരിച്ച് മാറ്റങ്ങൾ ഇതിനു മുകളിൽ വരുത്തുക
myText = u''
wikiSite = wikipedia.Site(code=siteLangCode, fam=siteFamily)
myOutputPage = wikipedia.Page(site=wikiSite,title=outputPage)
for myPage in pagegenerators.AllpagesPageGenerator(start =startPage, namespace=None, includeredirects=False,site=wikiSite):
wikipedia.output("Working on " + myPage.title())
if checkString in myPage.title():
wikipedia.output(myPage.title())
myText=myText+"#[["+myPage.title()+"]]\n"
myOutputPage.put(myText)
wikipedia.stopme()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment