alfanous
alfanous copied to clipboard
Twitter Application
A twitter application that post an Ayah every day linked to a searched query in the website www.alfanous.org
- Creating an application: https://dev.twitter.com/apps
- Posting tweets: https://dev.twitter.com/docs/api/1.1/post/statuses/update
Very interesting !
Would love to contribute !
No one has started this yet. I don't know how complicated it is but you may start with reading the twitter API docs, https://dev.twitter.com/docs
Here is an example of the twitter application developed at KSU ( King Saoud University)
http://quran.ksu.edu.sa/tw/
Great thanks !
I already had an experience with Twitter API. I will start on working on it after a couple of weeks, you can count on me ;)
Hi Assem, Could you explain more clearly how Ayas are chosen to be published on Twitter?
I am not sure about How they are doing it in http://quran.ksu.edu.sa/tw/, however this is my point of view:
- Not all ayas can be published, some are too long, some has no "self independent meaning" ===> so we should make a list for publishable ayas [1, 3, 4, ... 6110, 6212], this can be implemented inside the app or in the API.
- The choice goes randomly with no repetition from the publishable aya list, that means: if you published aya 5234 for the User X, so flag this aya as "published" and remove it from the list. when all ayas are published, reset the list.
- The ayah text should be unvocalized because the twitter length limit
- The ayah text should be in Standard script because the browser default font generally dont support Uthmani Script.
- The tweet should have a link to the Ayah in Alfanous , http://www.alfanous.org/?sortedby=score&recitation=14&query=sura%3A%22Al-Hajj%22%20%2B%20aya_id%3A36&translation=en.transliteration&page=1&unit=aya&view=default
This is how to request ayahs in Alfanous: Each aya is identified by the global identifier "gid" that has values from 1 to 6236 such as 1 is the first aya of alfatiHa and 6236 is the last aya of an-nass... the query is like that "gid:1", "gid:6236"..
the request to the API would be: http://www.alfanous.org/jos2?action=search&query=gid:6236
the request to the website would be: http://www.alfanous.org/?query=gid%3A6236&view=default&sortedby=score&translation=en.transliteration&recitation=14
https://code.google.com/p/python-twitter/
we cas use the tweepony library https://github.com/Mezgrman/TweetPony
I've worked with, here is an example of an automatic tweet in my account https://twitter.com/zsmahi/status/448540387133911040
I think we should approach by one of two ways.
First, is there an API that already does that (send tweets at fixed intervals). If so we use it.
Otherwise if possible we build a small webapp that does this by using Alfanous API externally and use this webapp for any other similar features that could be implemented externally.
@ahimta sending tweets requires the app to be authenticated in twitter so I think it should be a webapp. yet, we can use for it Django as same as the main website.
I don't think the application is hard, it just need a long breath to get it done.
Yes, sending tweets requires to be authenticated, web apps is the best solution, we can imagine it as a page web where users can subscribe to the App, once subscribed the APP can post automatically on their walls.