예제 #1
0
 def setUp(self):
     # Setup Hoiio credentials
     Hoiio.init(APP_ID, ACCESS_TOKEN)
예제 #2
0
파일: test_sms.py 프로젝트: 99co/hoiiopie
 def setUp(self):
     # Setup Hoiio credentials
     Hoiio.init(APP_ID, ACCESS_TOKEN)
예제 #3
0
 def test_without_auth(self):
     Hoiio.init(None, None)
     with self.assertRaises(HoiioException):
         Hoiio.voice.call(PHONE_NUMBER_1, PHONE_NUMBER_2)
예제 #4
0
 def test_init(self):
     Hoiio.init('a', 'b')
     self.assertEqual(Hoiio.voice.app_id, 'a')
     self.assertEqual(Hoiio.voice.access_token, 'b')
예제 #5
0
 def test_without_auth(self):
     Hoiio.init(None, None)
     with self.assertRaises(HoiioException):
         Hoiio.voice.call(PHONE_NUMBER_1, PHONE_NUMBER_2)
예제 #6
0
 def test_init(self):
     Hoiio.init('a', 'b')
     self.assertEqual(Hoiio.voice.app_id, 'a')
     self.assertEqual(Hoiio.voice.access_token, 'b')
예제 #7
0
from bs4 import BeautifulSoup
from hoiio import Hoiio

import urllib2
import re
import time

Hoiio.init('YOUR_APP_ID', 'YOUR_ACCESS_TOKEN')

url="http://www.mangareader.net/93/naruto.html"
origin_url = "http://www.mangareader.net"
page=urllib2.urlopen(url)
soup = BeautifulSoup(page.read())

latest = '/naruto/611'

while True:
	for link in soup.find_all(href=re.compile('naruto'), limit = 1):
		published = link.get('href')
		if(published != latest):
			#call hoiio API
			print("New Naruto: " + origin_url + published)
			res = Hoiio.sms.bulk_send("New Naruto: " + origin_url + published, 
				'+651111111',	#user 1
				'+651111112',	#user 2
				'',
				'', 								
				notify_url = ''
				)
				print res.bulk_txn_ref
				latest = published