It’s finally complete! The site is not overly complicated, it’s a Reddit-style site called Linkditt.com (I know what your thinking, I will replace that logo!). Essentially, users can view links posted by other users as well as vote them up and down, which in turn add or subtract points from the user’s overall score (like Karma). There is a “comment and share” page where users can use the Disqus commenting platform and share the post on their favourite social media platform.
There are several implementations that you will notice as you navigate the site:
- Infinite scrolling for posts, like you would see on Twitter
- Automatic sign in following signup (no need to remember your username!)
- Responsive design for mobile
- Password retrieval email system
- View all your past posts and edit them
There are tons of other little nuances that took me a while to wrap my head around. For instance, when you vote on a post the system knows how you voted previously (if you voted) and adds or subtracts a point depending on how your latest vote. You can’t accumulate votes for the same post this way. The problem here is that when you place your vote you should only see the posting’s total vote count go up or down by one. Originally, I had this going back to the database and pulling whatever the score was on that post but if you had many people voting at the same time, as they do on Reddit, then that number could jump by however many users voted since you refreshed your page. You might click up and the number could jump by five or ten votes! Thus, I had to implement a system that just added one to the number already on your page while ensuring that you stay within the +1 to -1 voting range. This is one of those things I took for granted from other sites before making this one!
For me, this proves that you can learn to code (a very useful skill nowadays) for very little money. If you have access to a computer and the internet all it takes is being very curious and very determined.
The only thing better than one opinion…is two opinions. Now, a user can choose to write an opinion article against an article already written. For example, the article below expresses an opinion, and just like before, that article and its author collect points based on the up (or down) votes given by other users. But now another user can choose to write an article with an opposing viewpoint should one not have already been written (see below).
This is essentially a digital version of a head-to-head newspaper editorial accept that anyone can post them! You may have also noticed the new Twitter Bootstrap template with a new side bar menu. Most don’t work but it’s a sign of things to come!
Day: 18 Budget: $? Spend: $0
Project Blackfish has some amazing new updates! Remember last week when I mentioned that users could now unlike articles as well? Well, there was a problem with that system: users could like and unlike articles as many times as they wanted. That has now been solved after some very steep learning in Django, particularly learning one-to-one and many-to-one relationships.
So here’s the lowdown: In the screenshot below you can see that if a user viewing an article has not liked an article it will say “You scored it: Rate this article!”
If the user clicks “like” the Total Point Score for the article increases by one as does the amount you scored it by. The trick here is that a user cannot like an article more than one time. They can become neutral again (Score = 0), or they can score it as -1. The user can change their score as many times as they want between -1 and 1.
Now here’s where things get really interesting! All articles are now tied back to the user that wrote it. When another user rates their article they receive Influence Points(iPoints). At the moment the user “test 4” has 0 iPoints, after their article was given a like they then receive one iPoint. If the user rating the article goes back and changes their mind “test 4” will have -1 iPoints. These points are accumulated from all of their articles so the more articles they write and the more users that like their articles the more iPoints they receive thus scoring their overall influence within the community.
Special thanks to Vikram, Vanessa, and Ildar for helping me with my logic and answering my never ending stream of questions!
Day: 8 Budget: $? Spend: $0
Everywhere, tons of coders are building software packages and making it freely available without making a dime off of it. I recently experienced a perfect example of just how useful and efficient this can be.
My goal was to have users fill in their city and country in their profile page, which I added recently:
What I realized is that I don’t want to leave it up to users to spell their city and country correctly, so I went on the hunt for a Django app that contained our world’s geographical information. I came upon two separate applications that I could plug in to my site’s code: Django Cities and Django Cities Light. The former is a much larger and more complex program than I needed at the moment so I went with the lighter version. The only problem was that when I tried to upload the data I kept receiving a duplicate error for some city in Latvia: Daugavpils.
I scratched my head and went to work googling the error but nothing came up. Finally, after searching long and hard I gave up and opened my first issue report on Github. The main contributor, jpic, responded shortly afterward along with several other coders who had the same problem. Over the next few days back and forth discussion solved the problem and another bug that popped up immediately afterwards. I was so impressed with this amazing collaborative effort and in particular, that of jpic, who went to town solving these problems in which he received no monetary compensation for. Coming from a finance and economics background I really found this refreshing.
Without the contributions to the community of open source developers working tirelessly on software such as Python, Django, and Cities Light, we definitely would not have the kind of web based technology we have today.
Special thanks to jpic for fixing my issue so quickly.
Day: 7 Budget: $? Spend: $0
I wanted to take a quick break on the progress of the site to quickly discuss learning to code. After spending a lot of money going to school, on both an undergraduate and a masters degree, I have decided that I never want to pay to learn again. With the amount of resources freely available online, for many things, in particular coding, you don’t have to.
After picking up SQL working at web startups I decided I should take the plunge and actually learn to code. I started with CodeAcademy and Zed A. Shaw’s LearnCodeTheHardWay. CodeAcademy allows you to practice your coding skills directly on their sight while LCTHW gets you to go through the necessary pains of coding through the command line. I actually went back and forth between the two because sometimes seeing the same thing explained different ways gave me a better understanding. Each site allows you to choose from various languages, deciding on the right one should be made using some careful research as to what you intend on doing with your coding skills. I chose to learn Python over other languages like Ruby because of its application to statistical packages and because of it’s reputation for being an easier scripting language to pick up.
For a framework I made the natural choice of Django since I studied Python. I think it is worth mentioning again Mike Hibbert’s video series available here, which I highly recommend.
If you find that you aren’t getting ahead as fast as you would like there are a number of great coding schools popping up that have hands-on classes lasting a few weeks. In Toronto there’s Hackeryou and the soon to be launched BrainStation.
Ultimately, with the amount of information freely available on the internet, you can learn just about anything. I’ve even learned to become a semi-competent guitar player without ever paying for a single lesson!
Day: 5 Budget: $? Spend:$0 Total Amount Spent Learning to Code: $0 (I did have to buy a computer but I’m not going to count that)
In my first blog in this series I mentioned that I was looking for suggestions to implement. A friend on LinkedIn reached out to me with a suggestion to upgrade my CSS framework with Bootstrap.
Even though I mentioned that I wasn’t going to change the appearance until later I decided that now would be a good a time as any to do something about it. So, I downloaded a bootstrap template and went to work connecting it. My front end skills are even more in their infancy than my Python scripting but I managed to hack something together that worked. Here it is, in all it’s glory:
I still have some work to do on the other template views but as you can see there is a vast improvement.
Let me know what you think: is this an improvement or not?
Special thanks to Ildar for the suggestion!
Day: 3 Budget: $? Spend: $0
Project Blackfish has a new added function! You may want to sit down for this: anyone, and by anyone I mean anyone logged into my computer, can not only like a post but unlike it as well! Ground breaking stuff, I know. Here is an example of two posts (please excuse the bad language, spelling, and grammer, someone got way too excited about foosball):
Total scores of the article can now be negative. There are a few problems still: anyone, even if they are not signed in, can vote as many times as they please, and I have no idea how many votes are up or down. So there is still a lot to do on that front.
Also, users can now insert there first and last name upon registration:
Other bugs include the header sign in not working properly, which has something to do with CSRF validation and I believe something to do with it being on the base HTML file. Can’t have unsuspecting users being hacked so that is a must fix.
Lastly, I had a problem with passwords of new users not being recorded and this stackoverflow link solved everything. Memo to self: learn more about the ‘super’ function.
Budget: $? Spend: $0