Skip to content
A Zotonic module. Repost any entry to Twitter/Facebook/Blogger/Livejournal etc.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


*NOTE*. It is a proof of concept, and not real working code until
        commit messages start saying otherwise ;)

A somewhat generic module to repost entries to various social sites: Twitter,
Facebook, Livejournal, Blogger etc.

The module itself is very dumb:

- read a list of modules that can actually repost stuff
- retrieve a reposting function from each module
- call each such function in turn


Reposting modules

Should implement exactly one function: repost_function/2

First argument to this function: configuration values specified for this module
Second argument: Zotonic context

This function must return a fun/2. This function will be called with EntryId as
the first argument and Zotonic Context as second argument.



repost_function(Config, Context) ->
  Username = proplists:get_value(username, Config),
  Password = proplists:get_value(password, Config),
  Fun = fun(EntryId, Context) -> 
          repost(Username, Password, EntryId)

repost(Username, Password, EntryId, Context) ->
  Body  = m_rsc:p(EntryId, body, Context),
  do_an_update_on_a_remote_site(Username, Password, Body).



There should be an entry called mod_repost in your config. It should contain 
configuration parameters for each repost module you want to use.

{mod_repost, [ {dummy_repost, [ {username, "foo"}
                              , {password, "bar"}]}
             , {repost_livejournal, [ {username, "foo"}
                                    , {password, "bar"}
                                    , {journal,  "test_journal"]}
Something went wrong with that request. Please try again.