First presentation
Just before the holidays, the teacher wanted to see a first preview of our product, so he could see how far we got and what was left to do.
This was somehow disappointing. The teacher which whom we have the PHP course doesn't even know what tags are. Neither he does about Twitter. He even seems to have problems understanding object oriented coding.
But we also were not really ready for a preview. We thought we had to hand in MsgHub in January after the holidays.
I had some major parts ready, but Most of them were objects (I had to learn object oriented programming in PHP first) and there was only little real word functionality.
So I had all these separate bits together. A lot of that stuff was just meant to work for the presentation and not to be used on the finished version.
For example I built a preview of adding people to your contact list and answering contact requests. But it only worked for a few cases that I wanted to show to the teacher.
I also built in the mailing part. We are using phpMailer_v2.1.0beta1 at the moment. We had some example code for creating and sending emails with that stuff. So I just copied and modified that example code and added it (together with some little pieces of logic) to the broadcastmessage file.
Holidays
Just after the presentation the holidays started and so we had much more time for coding.
Pundidas had a lot of stuff ready. Most importantly the whole signup and login stuff. But due to an accident with a filename, his Tortois svn client failed, so we first had to figure out what was going wrong with that thing (you can read about that on my blog here: http://bashvi.tumblr.com/post/2593384266/how-to-break-windows-subversion-updated)
After that he submitted the code. It was a series of huge and very important submits. The signup code is quite advanced and the interactive Ajax interface is very user friendly. I really hope he's going to write a blog post on how it's working and what he had to do to get it up and running himself, but he isn't the kind of guys putting stuff out to the internet...
Good work Pundidas!
About half of the commits we got so far were done in the last 30 days! http://code.google.com/p/msghub/updates/list
What I've been up to
On my side I spent some time on improving the work I had done for the presentation to a point where it could be released.
First I did some work on mysentmessages.php where you can see all the messages you've sent. You can also delete them from there. Right now it will really remove them form the database, so it's really very privacy oriented, but we might change it later.
All the php script for deleting the messages is inside the same file, so if you hit remove you will just return to the same page again. This makes the whole process more adorable I think and I plan doing this for some other pages too.
I also worked on mycontacts.php. It shows all the contacts in your contacts list and offers an option to delete them.
You can view a specific person's profile by opening up mycontacts.php?PeId=1 for example to view the profile of person with the ID 1. If you do so there's a button that offers to add the person to your contacts list.
If someone wants to add you, you'll see the request on top of your mycontacts. There you can either accept or reject the request. And there's a third option that will accept the request and add the person to your own contacts too.
If you're sending out a request for getting someone in your contacts list that already has you in his/her, he/she won't get a request, but instead he/she will just be added. (get more info on the topic by looking through our slides on contact management: https://docs.google.com/present/edit?id=0AQbzZZWCTcR7ZGsyYzJxbl8zM2RnN3FzM2hn&hl=en
Still there's some work to do both on mycontacts and on mysentmessages.
Getting it to work on a server out on the internet
Pundidas also got some space available on a real webserver where we can host our preview of MsgHub.
Bringing Diaspora up on that thing pointed out a very nasty thing - We have this file called dbconnect.php which includes a single line for connecting to the database. But it's using non-object-oriented style, so I can't use it in my objects. We had to change the settings in lots of files.
Also we had to enter mail and twitter properties in the specific files.
What we want to do, to make it easier to set up an own instance of msghub is to make a single config files where you can enter all the values and where all program files will access.
Looking ahead
so what's next?
We'll there are some important features still missing. But on Tuesday we're going to hand in the project, so there's not enough time left to implement all of them.
But on Monday I'll meet with Pundidas and discuss some stuff. As we are probably going to continue the project for another half a year, there will be time to implement the features.
So the first big thing that is still to come is what we call personal contacts. This will allow you to make sort of an own contacts list where you can have people in that are not on MsgHub (similar to how you have contacts in Outlook or whatever).
Pundidas is currently working on it and it's possible that it will be there until Tuesday.
But there is also some work that has to be done by me. For example I'll need to change all the objects related to contacts (Person.php, PersonProfile.php, ContactRequest.php, SearchedPerson.php, ...) in a way that they will recognize persons that do not have their own accounts on MsgHub.
I'll also do some other changes on the objects, so we can display more detailed information on persons.
The search function is still not implemented, but it is very important!
Also the settings can not be modified yet. The first thing I'm probably going to do (very soon I hope) is that you can view who has you in his/her contacts list and then revoke access, so they can't send you messages anymore.
Another topic that we'll have to discuss is our interface. Currently MsgHub does not look very attractive. It's all these weird colors and a lot of Lorem Ipsum text :D.
We'll definitely have to change that. But we are both coders and not web designers, so we'll probably have a hard time on that...
If this will all be done (hope we'll come to that point :D) the plan is to fix bugs and search for security issues. Pundidas would really like to integrate Facebook, so that's definitely on the todo list for the next half year.
And there are more changes, but I'll have to discuss some of them with Pundidas on Monday.
Oh... Well, and at some point we should tidy up the code (like looking that we're using the same functions for the same kind of jobs).
msghub
This blogg describes the development of Msghub.
Samstag, 8. Januar 2011
Sonntag, 12. Dezember 2010
A lot of work and a demo on Tuesday
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.
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.
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)