A lot has happened since my last post on msghub.
I have done quite a bit of work including the object oriented TwitterMessage which makes sending Tweets very easy. It takes all the things like 'is the person following me', 'can I send a private message' and the shortening of the message into account.
I've also written classes to handle profiles (to show them and to make it possible to search them). By today you can watch a persons profile on person.php?PeId=7 (or whatever Id you'd like to see). Searching for people is not possible yet, but I know how to do it and made an object that takes a lot of the work.
We have also spent a LOT of time thinking about how the privacy should be working and how finding and adding contacts has to work. You can see some of the results here!
We were a bit shocked when the teacher told us he wanted to see it on the 14.12.2010. We made an arrangement that we'll show the finished version after the winter holidays, but a demo of what we have so far on Tuesday.
We already had quite a bit of the work done, but it was in separate bits (like I could send tweets, but it was not included in the sending-process yet). So I spent the last night bringing stuff like this together.
By now the following is possible: view a persons profile, add to contacts, send a message - well there are more things that are almost finished or will only take a little bit of work. Beside that I don't really know how far Pundidas is, but I think it'll be enough for a demo.
Sonntag, 12. Dezember 2010
Donnerstag, 7. Oktober 2010
Learning JS and HOLIDAYS
Hey everybody (is there anyone reading this?)
There was no work on msghub for quite a long time. Well, I first had to learn some basic JavaScript (also because we'll have a test on school in about 3 weeks).
Pundidas is currently on holidays and I also took a few days off.
But I'm happy to tell you that I will go on with the development this weekend.
I will work on the view for 'sent messages' and on the Twitter-stuff. All messages will always be sent with our own addresses (as that is more secure for the user and easier for us). And so we will use our own Twitter-Account for sending your tweets (this might change in later versions, if there will ever be). If the receiver is following us I want to send a private message, if he's not I want to send a mention. So all I need are three things: Find out who is following us, send direct messages, send 'normal' messages.
I recently found some stuff that might make this very easy and so msghub might by supporting Twitter soon.
I'm also thinking a lot about the concepts of 'finding' other users on our platform. It does not make any sense to enter all email/twitter/facebook/... addresses of your friends if they are on msghub too. But there are some hard problems.
If you could search for them everyone could come along and grab all that information. If we pretend that by only showing one Address (f.e. email) someone might enter your friends email but his own Twitter account. If you then search for your friend in order to send him a message, you will find him and assume that's it's really him, because the email-address matches. But you would not see the wrong twitter account. Your friend would indeed get the mail, but the tweet would go to the attacker.
We want to prevent both things but atm I can't see a way to do that yet.
I'm really thinking alot about it! If you have any great idea please tell us!
There was no work on msghub for quite a long time. Well, I first had to learn some basic JavaScript (also because we'll have a test on school in about 3 weeks).
Pundidas is currently on holidays and I also took a few days off.
But I'm happy to tell you that I will go on with the development this weekend.
I will work on the view for 'sent messages' and on the Twitter-stuff. All messages will always be sent with our own addresses (as that is more secure for the user and easier for us). And so we will use our own Twitter-Account for sending your tweets (this might change in later versions, if there will ever be). If the receiver is following us I want to send a private message, if he's not I want to send a mention. So all I need are three things: Find out who is following us, send direct messages, send 'normal' messages.
I recently found some stuff that might make this very easy and so msghub might by supporting Twitter soon.
I'm also thinking a lot about the concepts of 'finding' other users on our platform. It does not make any sense to enter all email/twitter/facebook/... addresses of your friends if they are on msghub too. But there are some hard problems.
If you could search for them everyone could come along and grab all that information. If we pretend that by only showing one Address (f.e. email) someone might enter your friends email but his own Twitter account. If you then search for your friend in order to send him a message, you will find him and assume that's it's really him, because the email-address matches. But you would not see the wrong twitter account. Your friend would indeed get the mail, but the tweet would go to the attacker.
We want to prevent both things but atm I can't see a way to do that yet.
I'm really thinking alot about it! If you have any great idea please tell us!
Montag, 13. September 2010
Some useful PHP functions
I spent most of the passing weekend coding on the msghub-project. In fact I only coded at night cause that seems to be the time when I can code best. I'm normally coding until 2-4 am and then sleeping until 2-4 pm :D
We've made some progress this weekend. You can now enter messages and they will be stored to the database. It's not a great deal, I know, but it's a first step.
@Pundidas was even able to write the code needed to send email!
I had already done some php in a course this summer. Back then I've written a very simple blogging-system. For the things I was doing this weekend I could use a lot of the code I've written back then and some of the experiences I made back then.
However there are many things I want to do better this time. So a lot of Google-research was part of my work this weekend.
I was looking for solutions for some problems involved with writing data to MySQL database and with processing data and strings.
Even thought it's nothing big I've discovered I wanted to share some of the things with you. Maybe someone will one day be happy to find this post (probably not, but at least I will be able to remember better :p).
I like the idea of tags and so I wanted to include them to msghub. So I've built a filed where you can enter comma-separated tags. I then needed a possibility to process each tag by it self. So first I had to split them up. For this task I used the function exploed. It will split a string on a specific symbol (in my case the comma (,)) and write the substrings into an array. Very useful!
Next I wanted to remove the spaces at the end and the start of the tags so there would not be the same tag twice in the database (once with and once without spaces). PHP offers a dedicated function for this task too. It's called trim.
After writing some code to process the tags I've written some that would read the tags from the database. I got some problems with that. I could not process the date I read from the database. For some reason it just didn't work. After about one hour(!) I found out what I was doing wrong.
The data was somehow 'wrong formated' or something. However the method mysql_fetch_assoc solved the problem :)
Two other methods useful for processing strings are strlen, which returns the length of a string and substr, which can be used to cut strings. It takes the start point, where the substring shall start and how long the substring shall be.
At the start of the post I promised you a method for database access.
Now the problem I had was that after writing some data to the database I had to find out which was the primary key of the entry I just generated. Of course I could just search for the highest entry, but when thousands of operations would be performed to the database that might cause errors and return wrong values.
So I was looking for something better. And again it turns out that PHP offers something for exactly this task. It's called mysql_insert_id(). But I'm using MySQL improved so it's mysqli_insert_id. They are both doing the same. They return the last PrimaryKey that was written to the database from the clien't connection over which the request comes. So you don't even have to be worried that someone else is writing an entry to the database before you can read out this value. GREAT!
We've made some progress this weekend. You can now enter messages and they will be stored to the database. It's not a great deal, I know, but it's a first step.
@Pundidas was even able to write the code needed to send email!
I had already done some php in a course this summer. Back then I've written a very simple blogging-system. For the things I was doing this weekend I could use a lot of the code I've written back then and some of the experiences I made back then.
However there are many things I want to do better this time. So a lot of Google-research was part of my work this weekend.
I was looking for solutions for some problems involved with writing data to MySQL database and with processing data and strings.
Even thought it's nothing big I've discovered I wanted to share some of the things with you. Maybe someone will one day be happy to find this post (probably not, but at least I will be able to remember better :p).
I like the idea of tags and so I wanted to include them to msghub. So I've built a filed where you can enter comma-separated tags. I then needed a possibility to process each tag by it self. So first I had to split them up. For this task I used the function exploed. It will split a string on a specific symbol (in my case the comma (,)) and write the substrings into an array. Very useful!
Next I wanted to remove the spaces at the end and the start of the tags so there would not be the same tag twice in the database (once with and once without spaces). PHP offers a dedicated function for this task too. It's called trim.
After writing some code to process the tags I've written some that would read the tags from the database. I got some problems with that. I could not process the date I read from the database. For some reason it just didn't work. After about one hour(!) I found out what I was doing wrong.
The data was somehow 'wrong formated' or something. However the method mysql_fetch_assoc solved the problem :)
Two other methods useful for processing strings are strlen, which returns the length of a string and substr, which can be used to cut strings. It takes the start point, where the substring shall start and how long the substring shall be.
At the start of the post I promised you a method for database access.
Now the problem I had was that after writing some data to the database I had to find out which was the primary key of the entry I just generated. Of course I could just search for the highest entry, but when thousands of operations would be performed to the database that might cause errors and return wrong values.
So I was looking for something better. And again it turns out that PHP offers something for exactly this task. It's called mysql_insert_id(). But I'm using MySQL improved so it's mysqli_insert_id. They are both doing the same. They return the last PrimaryKey that was written to the database from the clien't connection over which the request comes. So you don't even have to be worried that someone else is writing an entry to the database before you can read out this value. GREAT!
Samstag, 28. August 2010
Introduction
Pundidas and I (bash_vi) are both students doing an apprenticeship in IT.
Now in the third year, we have to do a PHP-project. We could have done the boring stuff with the rest of the class, but we are both advanced in PHP-coding (or do at least think we are in my case...) so we decided to do something else.
The idea behind MsgHub is the following:
People are using a lot of tools and services for communication nowadays like Twitter, Facebook, E-Mail, instant messaging, sms, phone,...
Nevertheless, or maybe because of that, it is sometimes hard to contact someone if you need something instantly. How can you reach someone? Has he turned his mobile on? Would it be faster if he could type an email? Is he at home and twittering anyway?
By contacting someone only on one channel you are risking that you will have to wait for an answer for some time. But writing on all channels would consume a huge amount of time and maybe you also don't know all the channels of a particular person.
The idea is, that MsgHub will solve this problem. We won't create a new channel for communication, but an interface for broadcasting messages to a particular person.
Everyone can register on MsgHub and enter all his channels. If someone else now needs an instant answer, he just logs into MsgHub, searches for the person he wants to reach and enters the message.
MsgHub will the broadcast this message to all the channels of the receiver.
This will dramatically increase the probability that the person actually notices that someone tries to reach it.
For sending the messages, MsgHub will use it's own accounts on the different services. So there will not be any need for entering you passwords. Whenever possible it will send private messages.
For services like Twitter we are planning to just inform someone with a short message like "XYZ want's to contact you on the topic of ABC, please check your email!"
Of course there are a lot of problems involving privacy in the concept. We are just in the start phase of the project and thinking a lot about concepts and privacy and at this point I'm not currently able to tell or promise a lot. There's only this one thing we know and we think is great: You don't have to know all channels of a person to contact it. It's completely enough if you know the name. MsgHub will broadcast the message to all the channels it does know, not to the ones the sender knows. And it will not tell these channels (and not even which ones it does use) to the sender. Great, ain't it? :D
The first interface for the service will, obviously a webpage written in PHP. But we are imagining much more. There could be clients for different smartphone operating systems that would first try to phone someone, then send an sms and, if no answer comes back via sms over 10 minutes (or whatever amount of time you wish), it would start the broadcasting.
Currently we are designing a database-sheme that can easily be extended for including new services. We are also looking for good howtos and PHP libs to communicate with the APIs of Twitter and Facebook and with the POP/SMTP interface of E-Mail servers.
The development of MsgHub is OpenSource. Check http://code.google.com/p/msghub/ for more information.
If you would like to join the development or you have a great idea, write to msghub [at] googlegroups.com.
Have Fun!
Abonnieren
Kommentare (Atom)