{"id":11,"date":"2008-07-16T20:19:55","date_gmt":"2008-07-16T19:19:55","guid":{"rendered":"http:\/\/www.thomasgericke.de\/v3\/relaunch\/interactive\/blog\/?p=11"},"modified":"2009-03-12T22:06:04","modified_gmt":"2009-03-12T21:06:04","slug":"store-short-messages-sms-in-datebase","status":"publish","type":"post","link":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/2008\/07\/store-short-messages-sms-in-datebase\/","title":{"rendered":"Store Short Messages (SMS) in Database"},"content":{"rendered":"<p>Since I am a &#8220;everything has to be stored&#8221;-freak, I created a way to extract short messages (SMS) from my cellphone and store them into a MySQL-Datebase. I also wrote a simple PHP frontend which allows to display messages, to filter them by sender&#8217;s or receiver&#8217;s name and also to arrange them to (so called) conversations.Conversations may be very useful if you write lots of messages with a certain person and some short messages are about a specific topic.Here&#8217;s what you need:<\/p>\n<ul>\n<li>a cellphone with Symbian (e. g. UIQ3, S60v3)<\/li>\n<li>BestMessageStorer<\/li>\n<li>a Perl script<\/li>\n<li>a MySQL database<\/li>\n<li>an Apache webserver<\/li>\n<li>a PHP interpreter<\/li>\n<li>lots and lots of short messages \ud83d\ude42<\/li>\n<\/ul>\n<p>This is how to set up the database tables:<\/p>\n<p>Database tables sms and sms_conversations:<\/p>\n<pre class=\"brush: sql\">\r\nCREATE TABLE sms (\r\n  ID int(5),\r\n  conversation int(3),\r\n  src text,\r\n  dest text,\r\n  weekday text,\r\n  year int(4),\r\n  month text,\r\n  day int(2),\r\n  time text,\r\n  text text,\r\n  timestamp timestamp,\r\n  PRIMARY KEY(ID)\r\n)\r\n\r\nCREATE TABLE sms_conversations (\r\n  ID int(3),\r\n  name text,\r\n  PRIMARY KEY(ID)\r\n)<\/pre>\n<p>I won&#8217;t post the Perl scripts (one for reverting the order of extracted short messages, one for storing them in the database) here. I neither won&#8217;t post the PHP file. You may get in touch with me to optain them.<\/p>\n<p>Once you have this database up and running, you collected some short messages on your cellphone, getting them stored is as easy as 1-2-3. Here we go:<\/p>\n<ol>\n<li>safe messages to a file using BestMessageStorer<\/li>\n<li>transfer file onto a computer<\/li>\n<li>safe file with encoding &#8220;ANSI&#8221; (or anything else, whatever fits your needs)<\/li>\n<li>transfer file onto your server (on which you have the Perl scripts installed)<\/li>\n<li>process the file using:\u00a0<span style=\"font-family: 'courier new',courier;\"><strong>cat FILENAME | .\/reverse_file | .\/process_sms<\/strong><\/span><\/li>\n<li>finished<\/li>\n<\/ol>\n<p>Have fun! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I am a &#8220;everything has to be stored&#8221;-freak, I created a way to extract short messages (SMS) from my cellphone and store them into a MySQL-Datebase. I also wrote a simple PHP frontend which allows to display messages, to filter them by sender&#8217;s or receiver&#8217;s name and also to arrange them to (so called) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-tech"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":13,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/posts\/11\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thomasgericke.de\/v4\/interactive\/blog\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}