|
2010-04-27
, 04:00
|
Posts: 336 |
Thanked: 610 times |
Joined on Apr 2008
@ France
|
#2
|
|
2010-04-27
, 04:46
|
Posts: 336 |
Thanked: 610 times |
Joined on Apr 2008
@ France
|
#3
|
import sqlite3 class Conversation: def __init__(self, dbPath = '/home/user/.rtcom-eventlogger/el.db'): self.conn = sqlite3.connect(dbPath) self.c = self.conn.cursor() def getServices(self, serviceType = None): query = 'select id, name from Services' result = self.c.execute(query) if serviceType is not None: for (sid, sname) in result: if serviceType.upper() in sname.upper(): return sid return result def getEventTypes(self, eventType): query = 'select id, name from EventTypes' result = self.c.execute(query) if eventType is not None: for (eid, ename) in result: if eventType.upper() in ename.upper(): return eid return result def getSMSsFromBetween(self, low, high): sid = self.getServices('sms') eid = self.getEventTypes('sms_inbound') query = "select start_time, free_text from Events" query += " where service_id = %s and event_type_id = %s" % (sid, eid) query += " and cast(remote_uid as integer) between %s and %s" % (low, high) return self.c.execute(query) if __name__ == '__main__': convo = Conversation() nagios = convo.getSMSsFromBetween(0, 9999) for text in nagios: print text
|
2010-04-27
, 14:17
|
Posts: 336 |
Thanked: 610 times |
Joined on Apr 2008
@ France
|
#4
|
import gtk import hildon import gobject from datetime import datetime import pango from smsParser import Conversation def main(): gtk.set_application_name("SMS Filter") program = hildon.Program.get_instance() window = hildon.Window() program.add_window(window) window.connect("delete_event", gtk.main_quit, None) pana = hildon.PannableArea() treeview = gtk.TreeView() treemodel = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) treeview.set_model(treemodel) treeview.set_headers_visible(True) firstRenderer = gtk.CellRendererText() firstRenderer.set_property("alignment", pango.ALIGN_CENTER) secondRenderer = gtk.CellRendererText() secondRenderer.set_property("wrap-mode", gtk.WRAP_WORD) secondRenderer.set_property("wrap-width", 640) column = gtk.TreeViewColumn("Date", firstRenderer, text=0) column.set_min_width(160) treeview.append_column(column) column = gtk.TreeViewColumn("Text", secondRenderer, text=1) column.set_max_width(640) treeview.append_column(column) convo = Conversation() results = convo.getSMSsFromBetween(0, 9999) for (timestamp, text) in results: t = datetime.fromtimestamp(timestamp) treemodel.append((t.strftime("%Y-%m-%d\n%H:%M:%S"), text)) pana.add(treeview) window.add(pana) window.show_all() gtk.main() if __name__ == "__main__": main()
import sqlite3 class Conversation: def __init__(self, dbPath = '/home/user/.rtcom-eventlogger/el.db'): self.conn = sqlite3.connect(dbPath) self.c = self.conn.cursor() def getServices(self, serviceType = None): query = 'select id, name from Services' result = self.c.execute(query) if serviceType is not None: for (sid, sname) in result: if serviceType.upper() in sname.upper(): return sid return result def getEventTypes(self, eventType): query = 'select id, name from EventTypes' result = self.c.execute(query) if eventType is not None: for (eid, ename) in result: if eventType.upper() in ename.upper(): return eid return result def getSMSsFromBetween(self, low, high): sid = self.getServices('sms') eid = self.getEventTypes('sms_inbound') query = "select start_time, free_text from Events" query += " where service_id = %s and event_type_id = %s" % (sid, eid) query += " and cast(remote_uid as integer) between %s and %s" % (low, high) return self.c.execute(query)
run-standalone.sh python base.py
The Following User Says Thank You to CrashandDie For This Useful Post: | ||
|
2010-04-27
, 14:40
|
Posts: 4 |
Thanked: 2 times |
Joined on Jan 2010
|
#5
|
I use my N900 as a pager to get work related automated alerts. We use Nagios to monitor our DC. When I get a page it comes in with a seemingly random 4 digit number as the "from" address (3296, 3453, etc) I can't find a pattern to them. I've tried merging each different page under my Work Page card and that card now has close to 1000 different contacts under it and I still get new numbers.
What I end up with is 2500 - 3000 text messages a month as individual messages. I had the same issue when I was with ATT and had an iPhone. Their solution was another domain addy after my phone number (6015551212@mobile.mycingular.com). This fixed the issue and all alerts were coming in from one number which I could then create a contact card for and they would thread like a normal txt message conversation. This also worked with my N900 before I switched to tmobile.
I've talked to tmobile tech support and they were less than helpful. So my question is has anyone run into this before? if so what did you do to fix it? Also, is there a way that I could filter incoming sms and tag them on my phone under the right contact?