Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
compare: 282631ccf8797fc3b177367942eab23eb6e82996
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 02, 2012
arjun@mojolab.org FIxed AST_SOUND_DIR bug aef67d8
Commits on Mar 23, 2012
arjun@mojolab.org Minor updates 6723909
arjun@mojolab.org Added RSS feed creator (incomplete) 282631c
View
2  bin/menu_system_localized.py
@@ -50,7 +50,7 @@
SOUND_DIR = config.get("System","sounddir")
SOUND_DIR = SOUND_DIR + "/"
#PROMPTS_DIR = SOUND_DIR + 'prompts/hindi/'
-AST_SOUND_DIR = '/var/lib/asterisk/sounds/'
+AST_SOUND_DIR = SOUND_DIR
PROMPTS_DIR = SOUND_DIR + '/prompts/' + (language, 'english')[language == None] + '/'
sys.setrecursionlimit(15000)
View
0  conf/swaradb.sql 100644 → 100755
File mode changed
View
0  libs/database.pyc 100644 → 100755
File mode changed
View
53 tools/createrssfeed.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+import os,sys,time
+sys.path.append("/opt/swara/libs")
+from database import *
+from utilities import *
+import datetime, xmlrpclib
+import ConfigParser
+import ftplib
+import PyRSS2Gen
+config=ConfigParser.ConfigParser()
+
+db = Database()
+
+def getLastPushedPostID():
+ post=os.popen("cat lastrssedpost").read().strip()
+ return post
+
+def rss_item(post):
+ title = db.getTitleforPost('12345',post)
+ content = db.getContentforPost('12345',post) + "\n http://nbsvr1/audio/"+str(post)+".mp3"
+ #content = "<pre>[mp3-jplayer tracks='7355.mp3, url, FEED:http://10.16.16.14/swara/index.php?id=7355']"
+ link = "http://nbsvr1/swara/index.php?"+str(post)
+ time=db.getPostedTime('12345',post)
+ item="<item><title>"+title+"</title><description>"+content+"</description><link>"+link+"</link></item>"
+ return item
+if __name__=="__main__":
+ #Create Database object
+ postid=getLastPushedPostID()
+ posts=db.getUnpushedPostsInChannel(12345,postid)
+ if len(posts) == 0:
+ print "No unpushed posts"
+ exit()
+ os.system("cp /opt/swara/web/pyrss2gen.xml /opt/swara/web/swararss.xml")
+ xml = open("/opt/swara/web/swararss.xml","a")
+ for post in posts:
+ try:
+ xml.write("\n")
+ xml.write(rss_item(post))
+ xml.write("\n")
+ except:
+ print "Could not create RSS item %s" %post
+ continue
+ debugPrint("Final post = " + str(post))
+ os.system("echo %s > lastrssedpost" %(str(post)))
+ xml.write("</channel></rss>")
+ xml.close()
+
+
+
+
+
+
+
View
1  tools/lastrssedpost
@@ -0,0 +1 @@
+7336
View
0  tools/pullpost.py 100644 → 100755
File mode changed
View
0  web/api/getPost.php 100644 → 100755
File mode changed

No commit comments for this range

Something went wrong with that request. Please try again.