Monday, March 26, 2012

Fixing AddThis URL

codeXplode has recently started using AddThis to allow people to share project pages. We will probably develop our own solution eventually - we don't really like how buggy the Facebook button is and may need to implement a solution that wont show a 404 iFrame when the Facebook button is unavailable.

Until then, we will be using what's available to us. And we really do like AddThis. Not their fault they're stuck trying to deal with Facebook's inconsistencies.

The one thing that bugs us about AddThis, is that, by default, it tries to figure out the url to share. Which is cool, but way off most of the time. Especially once you begin passing arguments to each page using get.

For example, a page on codeXplode may look something like this.

https://www.codexplode.com/project.php?pid=1

Although, you can specify a page argument into the url to specify which page of the project you want to see - our navigation of course takes care of this. So the same page above, could be represented as shown below.

https://www.codexplode.com/project.php?pid=1&page=d

Both urls take you to the same page. The page=d just tells php to show the details page for the project. But if you don't specify a page, then it shows that page by default - to ensure something is shown.

This results in broken visitor analysis being performed by AddThis. Each of the above urls used to show completely different statistics.

Here's the fix. This is documented by AddThis, just can't remember where.

Simply add a addthis:url="http://example.com" to each of the anchor tags in the snippet that AddThis gives you to put into your page.

Hope this helps someone out there.

Saturday, March 24, 2012

AddThis HTTPS SSL Support

After trying to add the AddThis widget to the codeXplode page, I had become frustrated for the lack of support that AddThis offers for SSL. They claim you can just change the url in the script tag they give you to include https. I tried that. Chrome quit displaying the widget once I did that.

Seemed kinda strange at first, but once I followed their link myself, it became obvious. Chrome tries to grab the script over https, realizes that it sees an untrusted certificate and stops (it wants you to confirm that it's ok for it to continue). If it were an actual webpage, Chrome would of course prompt you. However, this is a script, so Chrome never has the chance to prompt you. Also, you don't want users of your site being prompted to add a certificate exception before they can run some simple javascript.

My solution. Navigate to the script's secure url yourself. Select the entire script's content and copy them to a javascript file on your server. Then modify the AddThis widget's code to reference your local server file rather than the remote one. This will be more secure and you wont have to worry about whether or not their certificate is trusted - just make sure yours is lol.

The only downside is that you will have to manually update the file if AddThis makes any changes to the javascript - not really a big deal in my opinion.

Thursday, March 22, 2012

Crawling the Web - Made Easy with Python

Earlier today, I began development on Code Crawler. I was stuck between Java and Python. Both have great networking libraries that are extremely easy to use. Java, being my first language, is easier to me, but that's actually what attracted me to Python as the choice for this project - the learning potential.

Anyways, after only maybe an hour of development, I have to say that I am extremely impressed with Python. I had a crawler, reading a list of seed urls from a file, pulling content off the urls, and checking each resources content type to ensure it was allowed (to avoid images) in about 30 lines of code. Not too bad at all.

You can check up on the status of this project here.

Code Crawler

In the previous post, I introduced the project I would be working on - aside from codeXplode. I code named it Code Crawler.

It's (or will be) a web crawler design specifically for finding code. Whether it's php, C, Java, Python or any other programming language known to man, the crawler job will be to find it and let codeXplode know of it's existence on the web.

I'm doing this in an effort to create an easily searchable resource for us programmers. Whenever I can't quite come up with a way to do something or if I've just forgotten, I want to be able to just search for the bit of code that I need and modify it appropriately for my use.

Anyways, the codeXplode profile for the Code Crawler project is up now and can be found here.

First Project - Web Crawler

codeXplode is first, a place for hosting repositories. Without a good project to develop, it's hard to test all of codeXplode's functionality. So I've been thinking about what project I would like to work on. The project I've finally decided on is a web crawler.

First, though, what is a web crawler? It's a piece of software, usually used by search engines such as Google but are sometimes used as a standalone alternative to the big web based search engines.

Mine, though, will be aimed at pulling code. It's priority will be to find snippets of code, break them down, and index them in such a way that will allow for code to be easily searchable. This will ultimately be built into the codeXplode feature set at some point. It will allow for users to search for certain functions, instead of having to search for a specific file or project.

Hence, the project's name will be Code Crawler. I will post a link to the codeXplode page for the project once it is created.

Sunday, March 18, 2012

Developing with Music

This post's title makes it sound a lot more interesting than it probably is in reality... unfortunately. It sounds like we're developing some platform for developing software using music. As cool as that would be, that's not what this post is about.

Really I just wanted to take a break from creating posts about the technical aspects and post something more... fun. And music always makes everything more fun - even programming.

The programmers of codeXplode are huge users of Spotify. We love it. We wouldn't be nearly as productive without the hours of music. If you don't already have an account, I strongly suggest getting one. It's free and you will be able to listen along with the codeXplode programmers.

And just for fun, here's the playlist we're currently using. Feel free to subscribe and what not. http://open.spotify.com/user/fallout0124/playlist/0gAo4woVWC7sLwLSXYTLj4.

Also, we have decided to create a collaborative playlist just for codeXplode. One where our programmers can listen, but are not allowed to modify it. We want our readers to modify it. Think of this as a kind of cool experiment where you can have direct control over what we listen to. Hopefully there will be some cool music on this. Have fun. Here's the link to the collaborative playlist. http://open.spotify.com/user/fallout0124/playlist/3cmm5iGa5VKDbNsfMjARvH

And in case you can't modify that playlist (you may have to add me on Spotify... not sure on this), here's a link to me on Spotify. http://open.spotify.com/user/fallout0124

Have fun,

Plans for Social Networking

The codeXplode team realizes that people (yes that includes programmers) are pretty attached to the whole idea of social networking. Also we feel it would fit in nicely with the ideas and plans for codeXplode. Therefore, codeXplode has plans to implement social networking into the site. This will allow users to follow other programmers and projects to easily stay up to date with there favorite projects and developers.

Tracking the development of a project or the users behind that project will be much like friending/following someone on Facebook or Google+. You will simply add them. Once they make a change, that change will appear on your feed.

If a project (that you are following) admin were to change the title of that project, then you would see an entry stating such on your feed. Also, if a project's member were to commit a new change, you would be notified of that as well.

Likewise, if you are 'friends' (or following) another user, then if they were to change one of there project's title, then that would appear on your feed. If they commit a change to a project they are a member of then you would see a feed entry for that.

There will be many other types of feed entries. The two mentioned here were just basic examples I'm using to show how social networking will work into codeXplode's features. I will have more in depth entries about codeXplode's social networking once we begin active development on those areas.