alfanous icon indicating copy to clipboard operation
alfanous copied to clipboard

Twitter Application

Open assem-ch opened this issue 11 years ago • 12 comments

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

assem-ch avatar May 31 '13 14:05 assem-ch

Very interesting !

Would love to contribute !

walidlaribi avatar Jun 04 '13 23:06 walidlaribi

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

assem-ch avatar Jun 05 '13 19:06 assem-ch

Here is an example of the twitter application developed at KSU ( King Saoud University)

http://quran.ksu.edu.sa/tw/

zsmahi avatar Sep 01 '13 22:09 zsmahi

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 ;)

walidlaribi avatar Sep 01 '13 22:09 walidlaribi

Hi Assem, Could you explain more clearly how Ayas are chosen to be published on Twitter?

KacemRostom avatar Sep 02 '13 08:09 KacemRostom

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

assem-ch avatar Sep 02 '13 09:09 assem-ch

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

assem-ch avatar Sep 02 '13 14:09 assem-ch

https://code.google.com/p/python-twitter/

assem-ch avatar Nov 16 '13 10:11 assem-ch

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

zsmahi avatar Mar 31 '14 21:03 zsmahi

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 avatar Apr 01 '14 00:04 ahimta

@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.

assem-ch avatar Apr 01 '14 00:04 assem-ch

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.

zsmahi avatar Apr 01 '14 00:04 zsmahi