|Browse in :||
> St.Ego's Blog
All > Topics > CMS Blog
Any of these categories - All of these categories
My Ping.fm Auto-Cross-Poster w/Snippets!
Then I discovered Ping.fm and have been using it ever since.
However, I was not able to publish the code snippets that I used to accomplish this for you, my readers... until now.
Thanks to the "code" tag handling by the SyntaxHighlighter that works with the BBcode module (some custom hacking to get it how I wanted it), I can now display code snippets in a legible format so that what I talk about can be more readily illustrated. But I digress...
The ease with which this snippet was up and running amazed even me, to be perfectly honest. For simplicity, I rigged it up to "pubtype" 19 in the articles module, which is for Tweets here on Ivory-Tower.
Just add the following to modules/articles/xaradminapi/create.php towards the end, right after the call to "xarModCallHooks". This ensures that everything else is created correctly first and eliminats new articles by other pub-types.
This works well for my Tweets, which go straight to publication, but what about articles pub-types that you draft or submit first?
Here you want to add your Ping.fm snippet to modules/articles/xaradminapi/update.php, towards the end, right after the call to "xarModCallHooks", again. For my implementation, I wanted to publish news articles (pub-type 1 on Ivory Tower) that were approved after being submitted (they are not created approved). The logic checks to make sure that the article status has changed and that it's new status is "approved":
As you can see, above, I am publishing simultaneously as both a "blog" and a "microblog". Depending on which social networking profile is involved, I have set it to only cross-post only to one or the other.
At some later point in time, I intend to move the snippets into their own module that can potentially be hooked to any other content item, complete with dynamic pubtype selection, etc. But I am content with having it in place for myself in the meantime.
Due to the number of requests for the snippet, it is now available for you to hack into your own Xaraya articles module! Enjoy.