mercredi 22 avril 2009

Drupal: Integrate Feedly shared links

I am pretty sure you have heared about Feedly (http://feedly.com/), a firefox plugin, a feed reader integrated with Google Reader (all your feeds can be read in feedly and what you share in feedly is accessible in Google Reader) .

Now my dilemma was to get "feedly shared links in my drupal instance". ?????????


I first as usual went to the headquarter (drupal.org :)) but nobody seemed interested by feedly right now. Then I changed my search; if I can get the Google Reader feeds that are shared then all shared links from feedly will be in the list (I can't imagine a better day ;-)).

So I went back to the HQ and I found 2 modules (don't ask me how :))
  • Activitystream: http://drupal.org/project/activitystream (thanks to akalsey )
  • Activitystream_greadershared: http://drupal.org/node/293402#comment-966480 (thanks to eojthebrave)
The first module is an API for "streams" created in other platforms (delicious, facebook, etc.)
The second, that is a patch/module, gets shared feeds from Google Reader.

How to use them ...

1- Download and install (enable) both modules
2- Get your Google Reader user Id ( in your google reader, click on the “Shared items” and then “Show details”). The user id is displayed in this format Feed URL: http://www.google.co.in/reader/public/atom/user/USER_ID/state/com.google/broadcast
3- Go to "My account" in your drupal instance
4- Paste your Google reader user Id in the “User ID Number: “ field

And you can start going home ;-)

mercredi 15 avril 2009

A new drupal module: userdashboard

I am working this last days on a new drupal module "userdashboard". You will probably say "another module?", "what is so cool about it?", etc. And you may be right but I need to tell first why this new module needs to be checked.

- The dashboard feature ...
Having my page, with my 'content containers' that I can arrenge as I want is something we all look for when we visit a portal/web site.

- The key here is the fact of using 'blocks'...
A block can have all type of information and in case a module is not providing a block that by default the 'views' module is there to help to display the content generated.

So the idea is that if I can display blocks , I can display everything I want (at least what the site admin want me to :), he is the boss).

Thus the module is allowing the admin to select 'allowed' blocks, that the user can 'manage' and then be able to view them on his dashboard.

There are things (especially the UI) I need to improve but I think this can ROCK...

Now why don't you take a look at it http://202.53.13.107:9007/ and tell me why I should stop/continue dreaming about it ? :)

lundi 13 avril 2009

How to add Google analytics to your blogspot blog ?

I finally figure out how to get and see statistics of my blogger blog (when I think I almost shifted because of that hehehe)...

Anyway I was searching and found some tips but they were not working. The main cool tool often mention is Google Analytics BUT it wasn't working for me because for security purpose "the code of google analytics" was parsed (the javascript code).

So before start yelling :) I thought of paying a visit to blogger's gagdets and I realised that this was in fact THE INSPIRATION :).

So now that it is working I'll show you the way, follow me ...

1- Create an account on Google Analytics (I won't show you how to do it, at least not today:) )
2- Copy the javascript code to your blog address
3- In your blogger administration panel go to "Layout" > "Page elements"
4- And in your footer choose "add a gadget" (you may need this http://help.blogger.com/bin/answer.py?hl=en&answer=141483)
5- Choose an "HTML/javascript code block" and paste the google analytics code in the block content.

And you are done. From now on you can view cool statistics for your :)

mercredi 1 avril 2009

Drupal: Modifying core code

I was thinking of one of the best way to "touch" core code (drupal or contributed modules).
This aspect matters when an upgrade is needed. The easier it is the happier you are.

And right now I think I find a "smooth" way.
Let's assume I really need to change the node_save function in the node.module file (I know you were saying: "ALWAYS TRY TO AVOID TOUCHING people's code" :-)).

1- I'll rename the default function to mv_node_save (in node.module) for example.

2- Include, in node.module, my file modif_node.module created in "sites/all/modif_code/modif_node/". And in my new file i will put the code in the node_save function.
So my new instructions will be taking into account without having to do many 'gymnastics'.

3-Keep track of patches : Once the code is in production (basically after major testing), generate patch file to keep track of what has changed. So in my case node.patch will mention only my include and the function renamed.

Thus the day i will need to upgrade, i will change only my code and maybe rename function.
I need to check all this and probably think of some details after some projects.

But I think this approach will make life less painful every time the "upgrade" word is appearing somehere :-).





! test and see ...