Latest Episode
 

Go Back   Keith and The Girl Forums Keith and The Girl Forums Talk Shite

Talk Shite General discussion

Reply
 
Thread Tools Display Modes
Old 07-06-2009, 06:04 PM   #601 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by hypercrypt View Post
That sucks! I really need to get a GS. Does it work okay on ARM6 when it is a fat binary? I am using SBJSON too, but I have just copied the files over into my project.
Must be using a compiler flag that trips up SBJSON, I wonder if I can disable the optimization on just this library.
(Offline)   Reply With Quote
Old 07-06-2009, 06:06 PM   #602 (permalink)
Senior Member
 
hypercrypt's Avatar
 
Join Date: Nov 2006
Location: My Place: Liverpool. Born and raised in Berlin.
Posts: 771
Mine may be tripping up too, I don't have a GS to test... May have to get one this week...
(Offline)   Reply With Quote
Old 07-06-2009, 08:05 PM   #603 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Snazzed up twitter tab:
Added tweets from @KATGShowAlerts to the default view
Added tweets to @keithmalley to the extended view (not sure how that one slipped through til now)
Reshuffled the layout, made the icons bigger
Changed the calculation for height so it's not silly tall


Still working on:
Caching icons (I got code that I know is good, but won't actually save the file, I'm sure it's just something stupid)
Rounding icons (CGFucking anything make me want to kill myself dead)
Add grad to drill down views

http://katgapp.com/07-06-09-KATG.com.zip
__________________
If you like the KATG app feel free to kick in some bucks (or don't)
KATGIPHONE Donation

Last edited by hayroob; 07-06-2009 at 08:15 PM.
(Offline)   Reply With Quote
Old 07-07-2009, 02:22 AM   #604 (permalink)
Senior Member
 
aptmunich's Avatar
 
Join Date: Sep 2005
Location: Munich, Germany
Posts: 621
Okay, finally got around to it. All the streaming settings worked fine!
The twitter section looks much better as well!

The settings look a bit odd: I'd put the 'Stream over cellular' as text on the background and only use the white container for the actual lines with buttons. Same for the warning text. But I'm sure you've planned that already
(Offline)   Reply With Quote
Old 07-07-2009, 10:25 AM   #605 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
even snazzier twitter tab:
Cached Icons
Added Grad to drill down views

Still working on:
Rounding icons (CGFucking anything make me want to kill myself dead)

http://katgapp.com/07-07-09-KATG.com.zip
(Offline)   Reply With Quote
Old 07-07-2009, 01:47 PM   #606 (permalink)
Senior Member
 
firefighter_chick's Avatar
 
Join Date: Jul 2007
Posts: 994
error?
Attached Images
File Type: jpg help.jpg (130.9 KB, 3 views)
(Offline)   Reply With Quote
Old 07-07-2009, 02:41 PM   #607 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
If anybody is having trouble installing I would start by referring back to the first post in this thread, I have added additional, more detailed instructions that may help.
(Offline)   Reply With Quote
Old 07-07-2009, 04:27 PM   #608 (permalink)
Senior Member
 
Join Date: Apr 2006
Location: Germany (American)
Posts: 339
I had errors before ( see page 2! ), but I just tried again with the current build and it worked. Hats off to you guys - this app is ACES!
(Offline)   Reply With Quote
Old 07-07-2009, 04:40 PM   #609 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by ryanvc76 View Post
I had errors before ( see page 2! ), but I just tried again with the current build and it worked. Hats off to you guys - this app is ACES!
Gratuities are accepted in the form of donations (to the app or the show with a note about the app being tits) or choice pictures from Junedon.
(Offline)   Reply With Quote
Old 07-07-2009, 05:22 PM   #610 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
I may have already posted this, but I am too lazy to go back and look and I have tuned it a little. It works with the PHP token server I posted a while back. You export your cert as a .p12 and convert to pem, I've posted some stuff about that somewhere in this thread.

Code:
#----------------------------------------------------------------------------
#	Name: TwitterNotifications.py
#	Author: Doug Russell
#	Last Modified: 07-07-09
#	Created with Python 2.6
#	Description: Allows for APNS pushes from twitter
#	Usage: Set up a twitter account for receiving the @ messages and then
#	add that to the config file, then add your user that the message will
#	come from where it is marked below. The first time you launch add the 
#	--prime flag so that old messages won't get resent.
#	Require: Python Twitter Tools
#----------------------------------------------------------------------------
#	Copyright (C) 2008 Doug Russell
#	
#	This program is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#	
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#	
#	
#	You should have received a copy of the GNU General Public License
#	along with this program.  If not, see <http://www.gnu.org/licenses/>.

from twitter import *
from xml.dom.minidom import parse, parseString
from ConfigParser import SafeConfigParser
import socket, ssl, json, struct
import urllib, time, sys, os
import pickle

def getTweets(d):
	credentials = loadConfig(os.path.join(os.getcwd(), 'config'))
	try:
		twitter = Twitter(credentials.get('user'), credentials.get('pass'))
		tweets = twitter.replies()
	except:
		return d
	t = []
	for tweet in tweets:
		x = tweet.get('user')
		if x.get('screen_name').lower() == 'YOURSENDINGUSER': # add in your user here
			time = tweet.get('created_at')
			body = tweet.get('text')
			if not(time in d):
				print 'Send notification:'
				send(body[9:])
				d[time] = body
	return d


def prime(d):
	credentials = loadConfig(os.path.join(os.getcwd(), 'config'))
	twitter = Twitter(credentials.get('user'), credentials.get('pass'))
	tweets = twitter.replies()
	t = []
	for tweet in tweets:
		x = tweet.get('user')
		if x.get('screen_name').lower() == 'YOURSENDINGUSER':
			time = tweet.get('created_at')
			body = tweet.get('text')
			if not(time in d):
				d[time] = body
	return d


def send(Message):
	print Message
	url = 'http://YOURWEBSITE.com/tokenLog.php'
	data = 'userid=YOURUSERID&password=YOURPASSWORD&submit=Submit'
	filehandle = urllib.urlopen(url, data)
	
	time.sleep(5)
	xml = filehandle.read()
	xmldoc = parseString(xml)
	nodeArray = xmldoc.getElementsByTagName('deviceToken')
	tokens = []
	for node in nodeArray:
		try:
			deviceToken = node.firstChild.toxml()
			tokens.append(deviceToken)
		except:
			continue
	
	sound = 'keithandthegirl.com.caf'
	
	for deviceToken in tokens:
		thePayLoad = {
			'aps': {
				'alert':Message,
				'sound':sound,
				'badge':1,
				},
			}
		
		theCertfile = 'dist_cert.pem'
		theHost = ('gateway.push.apple.com', 2195)
		
		data = json.dumps(thePayLoad)
		deviceToken = deviceToken.replace(' ','').decode('hex')
		
		theFormat = '!BH32sH%ds' % len(data)
		theNotification = struct.pack(theFormat, 0, 32, deviceToken, len(data), data)
		
		ssl_sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM), certfile=theCertfile)
		ssl_sock.connect(theHost)
		ssl_sock.write(theNotification)
		ssl_sock.close()


def loadConfig(filename):
	options = ({})
	if os.path.exists(filename):
		cp = SafeConfigParser()
		cp.read([filename])
		if cp.has_option('twitter', 'user'):
			options['user'] = cp.get('twitter', 'user')
		if cp.has_option('twitter', 'pass'):
			options['pass'] = cp.get('twitter', 'pass')
	return options


try:
	pkl_file = open('d.pkl', 'rb')
	d = pickle.load(pkl_file)
except:
	d = ({})

for arg in sys.argv:
	if arg.startswith('--prime'):
		prime(d)
		print 'Primed'

try:
	doAction = lambda : getTweets(d)
	while True:
		print time.strftime("%a, %d %b %Y %H:%M:%S")
		d = doAction()
		time.sleep(40)
except KeyboardInterrupt:
	output = open('d.pkl', 'wb')
	pickle.dump(d, output)
	output.close()
	print >>sys.stderr, '\n[Keyboard Interrupt]'
	pass
config file
Quote:
[twitter]
user : YOURRECEIVINGUSER
pass : YOURPASSWORD
(Offline)   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT -5. The time now is 08:47 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Keith and The Girl