Forum OpenACS Development: I have created Facebook and Twitter Includelets

Having spent some time just recently finally getting to grips with the xotcl includelet code.  Amongst other things I have been experimenting with adding some social media links via new includelets.

The includelets I have added are:

1.  {{tweet -via "" -url "" -text "" -count ""}}

This adds 'Tweet' button with counter to a page, and as such therefore to each Weblog posting if the content is viewed using the weblog viewer.

2.  {{tweets -twitter_user "" -shell_bg "" -shell_color "" -tweet_bg "" -tweet_color "" -tweet_links "" -scrollbar false -loop false -live false -behaviour default}}

This adds a Twitter Widget.  I have coded it to expose all the useful parameters, and they are pre-set with sensible defaults.

3.  {{facebook -description "" -url}}

This adds a Facebook 'Like' button to an xowiki page, and it will point to the individual post when viewed in the Weblog viewer.

4.  {{facebook-likebox -href "" -width 300px -height "" -colorscheme light -show_faces true -stream true -header true -border_color #cccccc -force_wall false}}

This adds a Facebook Like-Box to an xowiki page. I have exposed the useful parameters and set sensible defaults.

I would be happy to submit the code for consideration. If approved I would need to add some js resources to the openacs resources tree.

Regards
Richard

Collapse
Posted by Torben Brosten on
That's great, Richard.

Shall we start a social-networking package?

Is the code GPL'd (including javascript)?

Ecommerce has some social networking procs at tcl/social-networking.tcl that could be added to it.

Since these types of procs tend to require regular maintenance to keep up with changes, it seems appropriate to share the load in the community.

Collapse
Posted by Richard Hamilton on
Torben,

Thanks for the reply. That's an interesting question. I guess the Javascript fragments provided by Facebook/Twitter etc. may not be GPL, which is something I had not considered. Having said that, they clearly encourage free circulation and certainly in the case of Twitter are happy for the js files that are called to be locally sourced.

Perhaps this re-inforces the case for doing this stuff as xowiki includelets, because they simply plug-in and can be effortlessly included on xowiki content, so avoiding the complications by not being a de-facto part of openacs.

As Gustaf has provided a means of including xowiki pages in adp pages, as I understand it, an xowiki includelet can effectively be added (via adp include) to any adp page that openacs serves!

I would be very interested to hear more about your ideas to understand what the scope and objectives of the package you describe would be.

The includelets I have done are only little fragments in the grand scheme of things, but from little acorns...! 😊

Regards
Richard

Collapse
Posted by Torben Brosten on
Hi Richard,

Here's the social-networking code:

http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/ecommerce/tcl/social-networking-procs.tcl?hb=true

Basically provides minimal share code at the tcl level. The icons are not in CVS, but refer to ones on each of the social website vendors in order to not introduce non-GPL'd code into CVS.

Another useful proc provides a way to add default meta tags, when one or more of them are not defined at the page level. template::head::defaults_meta was briefly in CVS head at: http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/acs-templating/tcl/head-procs.tcl?r2=1.18&r1=1.17

It is a separate proc so as to not change the existing functionality of template::head::meta, which I think would require a TIP. defaults_meta adds the meta tag, only if the meta tag is not yet defined, whereas meta proc overwrites an existing tag.

I'd envision a social-networking package providing services for registration/login via other social-networking sites including OpenID, perhaps user tracking statistics in a manner that xowiki provides (optionally set via parameter) etc.

cheers,

Torben

Collapse
Posted by Torben Brosten on
change "metas" proc to "add_metas"

Would it make sense for the various procs at acs-temmplating/tcl/head-procs.tcl to use the create/read/write/delete variants that are common in other parts of the toolkit?