Forums : Technical Issue Help

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.blackduck.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

Oholo widgets and Trac wiki

Hi,

I would like to add Ohloh widgets to a Trac wiki page, however seems that Trac filters out the Javascript (for security reasons, I suppose).

I don't want to disable the security filters, so is there a way to add these widgets to Trac wiki ? If so, how ?

Regards,
Marco.

Marco Maccaferri almost 16 years ago
 

Hi Marco,

This is possible, but it requires using a custom Trac plugin.

There have been a few plugins made in the past, but I am not sure that any are still being actively supported.

If you are handy with Python and Trac then you should be able to get this plugin to work:

http://trac-hacks.org/wiki/OhlohBadgeMacro

This particular plugin restricts your Ohloh project id to an integer, which is not the case anymore: Ohloh allows you to use a project name instead of an integer id in the URL now.

We have a couple of old Trac plugins that are currently running on our Ohcount Trac site. They are simple variations on the plugin above, but unfortunately I can't find our local source code for them anymore. However, I do have the Python eggs that you can download:

TracOhlohBadge-1.0-py2.4.egg
TracOhlohAccountWidget-1.0-py2.4.egg

Drop the eggs in the plugins directory of your Trac deployment. Then add the following to your trac.ini:

ohlohbadge.macro.* = enabled
ohlohbadgewidget.* = enabled
ohlohaccountwidget.macro.* = enabled

Finally, you can place the widget in your Trac wiki pages with the following wiki markup:

[[OhlohBadge(10937)]]
[[OhlohAccountWidget([email protected])]]

For the project badge, you'll need to know the integer ID of your project. If you can't find this, let me know and I'll look it up for you.

For the account badge, you can supply either the account integer ID or the account email address, if you know it.

We are running a pretty old version of Trac, and I have no idea if these plugins will still work with later builds of Trac.

Anyways, that's a lot of random data -- it's been a few years since anyone looked into this. If you decide to give it a shot, let me know if you have trouble, and I might be able to help.

Thanks,

Robin

Robin Luckey almost 16 years ago
 

Hi Robin,

I've downloaded the source code from trac-hacks, it works well. I'm not very good at Python but managed to remove the number limitation and do few other changes to load other kind of widgets.

BTW, the links to the .egg files seems to not work (The page you were looking for doesn't exist).

Thanks,
Marco.

Marco Maccaferri almost 16 years ago