Beispiel #1
0
	def get(self):
		consumer_key = "F6IDVs26q1D93u7ChCcGQ"
		consumer_secret = "V1ucn0kbaMNMPORWnhVETlZJGL5bHOdTewUW5VTR4"
		access_token = "410814371-87pWoeU3KhSaH4ATk1QJfZ6zvGpUj8YlXU7Mh5Ga"
		access_token_secret = "QQoGEKVZRXLRtrd7agRNmJUB6YqvEf5GXCxWNenpsI"
		
		auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
		auth.set_access_token(access_token, access_token_secret)
		api = tweepy.API(auth)
		prayTimes = PrayTimes()
		
		from datetime import date
		PT = PrayTimes('Egypt')
		times = PT.getTimes(date.today(), (-8.58,116.11), +8);
	
		for i in ['Imsak','Subuh', 'Sunrise', 'Dhuhur', 'Ashar', 'Maghrib', 'Isha']:
			time = datetime.datetime.utcnow() + datetime.timedelta(hours = 8)
			timeString = time.strftime("%H:%M")
			
			if (times[i.lower()] == timeString):
				if i.lower() == 'imsak' :
					self.response.out.write('Waktu ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
					api.update_status('Waktu ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
				elif i.lower() == 'sunrise' :
					self.response.out.write('Waktu Terbit Matahari Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
					api.update_status('Waktu Terbit Matahari Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
				elif i.lower() == 'maghrib' :
					self.response.out.write('Waktu Sholat ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
					api.update_status('Waktu Sholat ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
				else :
					self.response.out.write('Waktu Sholat ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
					api.update_status('Waktu Sholat ' + i+ ' Untuk Kota Mataram pada pukul' + ' '+ times[i.lower()] + ' WITA')
Beispiel #2
0
    def get(self):
        consumer_key = "F6IDVs26q1D93u7ChCcGQ"
        consumer_secret = "V1ucn0kbaMNMPORWnhVETlZJGL5bHOdTewUW5VTR4"
        access_token = "410814371-87pWoeU3KhSaH4ATk1QJfZ6zvGpUj8YlXU7Mh5Ga"
        access_token_secret = "QQoGEKVZRXLRtrd7agRNmJUB6YqvEf5GXCxWNenpsI"

        auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
        auth.set_access_token(access_token, access_token_secret)
        api = tweepy.API(auth)
        prayTimes = PrayTimes()

        from datetime import date
        PT = PrayTimes('Egypt')
        times = PT.getTimes(date.today(), (-8.58, 116.11), +8)

        for i in [
                'Imsak', 'Subuh', 'Sunrise', 'Dhuhur', 'Ashar', 'Maghrib',
                'Isha'
        ]:
            time = datetime.datetime.utcnow() + datetime.timedelta(hours=8)
            timeString = time.strftime("%H:%M")

            if (times[i.lower()] == timeString):
                if i.lower() == 'imsak':
                    self.response.out.write('Waktu ' + i +
                                            ' Untuk Kota Mataram pada pukul' +
                                            ' ' + times[i.lower()] + ' WITA')
                    api.update_status('Waktu ' + i +
                                      ' Untuk Kota Mataram pada pukul' + ' ' +
                                      times[i.lower()] + ' WITA')
                elif i.lower() == 'sunrise':
                    self.response.out.write(
                        'Waktu Terbit Matahari Untuk Kota Mataram pada pukul' +
                        ' ' + times[i.lower()] + ' WITA')
                    api.update_status(
                        'Waktu Terbit Matahari Untuk Kota Mataram pada pukul' +
                        ' ' + times[i.lower()] + ' WITA')
                elif i.lower() == 'maghrib':
                    self.response.out.write('Waktu Sholat ' + i +
                                            ' Untuk Kota Mataram pada pukul' +
                                            ' ' + times[i.lower()] + ' WITA')
                    api.update_status('Waktu Sholat ' + i +
                                      ' Untuk Kota Mataram pada pukul' + ' ' +
                                      times[i.lower()] + ' WITA')
                else:
                    self.response.out.write('Waktu Sholat ' + i +
                                            ' Untuk Kota Mataram pada pukul' +
                                            ' ' + times[i.lower()] + ' WITA')
                    api.update_status('Waktu Sholat ' + i +
                                      ' Untuk Kota Mataram pada pukul' + ' ' +
                                      times[i.lower()] + ' WITA')
Beispiel #3
0
import scheduler
import time
from datetime import datetime, timedelta
from prayertimes import PrayTimes
from pytz import timezone
import pytz
import datetime

#---------------------- prayTimes Object -----------------------

if __name__ == "__main__":
    from datetime import date

    print('Prayer Times for today in Mataram-NTB/Indonesia \n' + ('=' * 41))
    PT = PrayTimes('Egypt')
    times = PT.getTimes(date.today(), [-8.58361, 116.113683], +8)

    for i in [
            'Imsak', 'Subuh', 'Sunrise', 'Dhuhur', 'Ashar', 'Maghrib', 'Isha',
            'Midnight'
    ]:
        time = datetime.datetime.utcnow() + datetime.timedelta(hours=+8)
        time = datetime.datetime(2013, 7, 10, 19, 21)

        #print i + ' : ' +times[i.lower()]
        #print i.lower() + ' :' + times[i.lower()]
        timeString = time.strftime("%H:%M")
        if (times[i.lower()] == timeString):
            if i.lower() == 'imsak':
                print('Waktu ' + i + ' Untuk Kota Mataram pukul' + ' ' +
                      times[i.lower()] + ' WITA')
import scheduler
import time
from datetime import datetime, timedelta
from prayertimes import PrayTimes
from pytz import timezone
import pytz
import datetime

#---------------------- prayTimes Object -----------------------
 
if __name__ == "__main__":
	from datetime import date
	
	print('Prayer Times for today in Mataram-NTB/Indonesia \n'+ ('='* 41))
	PT = PrayTimes('Egypt')
	times = PT.getTimes(date.today(),  [-8.58361,116.113683], +8)

	
	for i in ['Imsak','Subuh', 'Sunrise', 'Dhuhur', 'Ashar', 'Maghrib', 'Isha', 'Midnight']:
		time = datetime.datetime.utcnow() + datetime.timedelta(hours = +8)
		time = datetime.datetime(2013,7,10,19,21)
		
		#print i + ' : ' +times[i.lower()]
		#print i.lower() + ' :' + times[i.lower()]
		timeString = time.strftime("%H:%M")
		if (times[i.lower()] == timeString):
				if i.lower() == 'imsak' :
					print('Waktu ' + i+ ' Untuk Kota Mataram pukul' + ' '+ times[i.lower()] + ' WITA')
				elif i.lower() == 'sunrise' :
					print('Waktu Terbit Matahari Untuk Kota Mataram pukul' + ' '+ times[i.lower()] + ' WITA')
				elif i.lower() == 'maghrib' :
Beispiel #5
0
    forecastDays[i] = weather_com_result['forecasts'][i]['day_of_week'][0:3]
    forecaseHighs[i] = weather_com_result['forecasts'][i]['high'] + u'\N{DEGREE SIGN}' + "C"
    forecaseLows[i] = weather_com_result['forecasts'][i]['low'] + u'\N{DEGREE SIGN}' + "C"
    forecastPrecips[i] = weather_com_result['forecasts'][i]['day']['chance_precip'] + "%"
    forecastWinds[i] = "{:.0f}".format(int(weather_com_result['forecasts'][i]['day']['wind']['speed'])  / kphToMph) + \
        weather_com_result['forecasts'][i]['day']['wind']['text']   
     
    now = datetime.datetime.now()
    um = HijriDate(now.year,now.month,now.day,gr=True)
 
    Islamicdate=str(int(um.day))
    Islamicmonth=str(int(um.month))
    Islamicyear=str(int(um.year))
 
    PT = PrayTimes('Makkah')
    times = PT.getTimes((now.year,now.month,now.day), (lat, longi), 3,0)
    try:
        currTemp = weather_com_result['current_conditions']['temperature'] + u'\N{DEGREE SIGN}' + "C"
    except KeyError:
        print("Maybe net down")
             
    try:
        humid = "{}%".format(weather_com_result['current_conditions']['humidity'])
    except KeyError:
        print("Maybe net down")
         
        # blank the screen
        mytft.screen.fill(colourBlack)
         
    # Render the weather logo at 0,0
    icon = installPath+ (weather_com_result['current_conditions']['icon']) + ".png"