Project Y

Crazy dog writing code for fun

Resting fully…


I know I’ve been gone for a while but you know me I either bite you all the times or nap my life away. So now that I’m fully rested I figured why not messing with RestFul Services and WordPress. So I started on this plugin called WP Services using PureMVC. All you have to do is this on any page in the blog just add “wp-services/” right after the domain and you should get the xml output of that page. So for example will become … Do you get it? Also a few extra urls are ,,, , . K i’ll keep working on it would be cool to login, register and all of that as well I think.

Peace and have fun

Zo in the house!!!

posted under Bites | No Comments »

Proxy is not working…..


Damn i hate when those proxy don’t work do you? So I guess peeps like doggy style code and are trying to use the FeedMe Rss Reader. Since there are some proxy issues this is the code of the one I use:

K now what about sending me some bones, toys doggie stuff.

Taking a nap now l8z!!!

posted under Bites | No Comments »

FeedMe – RSS reader


K so this is the code for that FeedMe Class:


var FeedMe = new Class({
    Implements : [Options, Events],
    options : {
        template : '
', container : 'FeedMeContainer' }, initialize : function(options) { this.setOptions(options) }, eat : function(url) { this.fireEvent('start'); new Request({ url : url, onSuccess : this._eat.bind(this), onFailure : function(response) {this.fireEvent('failure', response)}.bind(this), onException : function(headerName, error) {this.fireEvent('exception', [headerName, error])}.bind(this) }).send(); }, _eat : function(responseText, responseXml) { this.fireEvent('success', responseXml); //console.log(responseText+' '+responseXml) //try { this._digest(responseXml); }, _digest : function(responseXml) { this.fireEvent('processing'); = new FeedMe.Channel(responseXml); this.outputContainer = $(this.options.container); ["title","link","description","pubDate","copyright"].each(function(item) { //console.log('chan-'+item); this.outputContainer.getElement('.chan-'+item).set('html',; }.bind(this)); var img = '', image =, src = image.get('src'); if (src != null) { var title = image.get('description'); img = ''+title+''; } this.outputContainer.getElement('.chan-image-link').set('html', img); this.itemsHtml = ''; { this.itemsHtml += this.options.template.replace( '#link#', ' ').replace( '#title#', '
').replace( '#desc#', '
') }.bind(this)); this.outputContainer.getElement('.chan-items').set('html', this.itemsHtml); this.fireEvent('done'); } }); FeedMe.Node = new Class({ initialize : function(element) { this.element = element; }, get : function(prop) { if (this.element) { if (prop != 'value') return this.element.get(prop); else this.element.childNodes[0].nodeValue; } return null; } }); FeedMe.BaseItem = new Class({ get : function(prop) { var elm = this.element.getElement(prop); if (elm != null) return elm.childNodes[0].nodeValue; return ''; } }); FeedMe.Item = new Class({ Extends : FeedMe.BaseItem, initialize : function(element) { this.element = element; this.category = new FeedMe.Node(this.element.getElement('category')); this.enclosure = new FeedMe.Node(this.element.getElement('enclosure')); this.guid = new FeedMe.Node(this.element.getElement('guid')); this.source = new FeedMe.Node(this.element.getElement('source')); } }); FeedMe.Channel = new Class({ Extends : FeedMe.BaseItem, initialize : function(xmlDoc) { this.xmlDoc = xmlDoc; this.element = this.xmlDoc.getElement('channel'); this.items = new Array(); this.xmlDoc.getElements('item').each(function(item) { this.items.push(new FeedMe.Item(item)); }, this); this.category = new FeedMe.Node(this.element.getElement('category')); this.image = new FeedMe.Node(this.element.getElement('image')); } });

mootools.ext.js just a quick extension for show and hide functionality

	visible: function() {
    	return != 'none';
	toggle: function() {
		if (this.visible())this.hide();
		return this;
	hide: function() { = 'none';
		return this;
	show: function() { = '';
		return this;
	smoothScrollTo: function(options){
		var options = $extend({},options||{elementOffset:0});
		try {
			var scrollY = (window.pageYOffset)?window.pageYOffset:document.documentElement.scrollTop;
			if ((!options.minPageOffset && !options.maxPageOffset) ||
			(options.minPageOffset && scrollY > options.minPageOffset) ||
			(options.maxPageOffset && scrollY < options.maxPageOffset))
			if (!__globalSmoothScroll) __globalSmoothScroll = new Fx.Scroll(window);

		} catch(e) {Logger.log('smoothScrollTo: '+e.message);}
		return this;

Test html file:

		<script src="/js/mootools.core.js" type="text/javascript"></script>
		<script src="/js/mootools.more.js" type="text/javascript"></script>
		<script src="/js/mootools.ext.js" type="text/javascript"></script>
		<script src="/js/feedme.js" type="text/javascript"></script>
		<link rel="stylesheet" href="/css/layout.css" />
		<script type="text/javascript">
		var feedMe = null;
		window.addEvent('domready', function() {
			feedMe = new FeedMe().addEvents({
				start : function() {showStatus('fetching..', 'start');$('FeedMeContainer').hide();},
				success : showStatus.pass('eating..','success'),
				processing : showStatus.pass('digesting..','processing'),
				done : function() {showStatus('dropping kids..','done');showResult.delay(1000);}
			$('sendit').addEvent('click', function() {
				var url = $('rssurl').value;
				if (url == '' || !/http/.test(url)) {
					alert('come on foo!');
		function showStatus(msg, className) {return $('feedingStatus').set('html',msg).set('class', className).show();}
		function showResult(){
	<div class="container">
	<input type="text" value="" id="rssurl" /> <input type="button" id="sendit" value="Feed Me!!"/>
	<div id="feedingStatus"></div>
	<div id="FeedMeContainer" class="rss" style="display:none;">
		<div id="chan-title"></div>
		<div id="chan-link"></div>
		<div id="chan-description"></div>
		<a href="javascript:void(0);" id="chan-image-link"></a>
		<div id="chan-items"></div>
		<div id="chan-pubDate"></div>
		<div id="chan-copyright"></div>

You will need a proxy to run outside script within your website or you’ll run into cross-domain issues

Damn I gotta go run with the Boss now I hate when he does that to me.

Later fools!

posted under Bites | No Comments »

Feed Me Feed Me!!!



So I was reading this post at Mootools User Group and i was also kind of hungry. So after a few bites and a quick nap I crancked some code to help this dude from Brazil out. I hope he sends me a bone man!

I think this should do it.

Title: FeedMe
Description: Rss reader

Do you like it? I will put the code up shortly for now look it up with FF or Firebug or hack it damn it.
Gotta go for my walk now Boss is home :)

Peace out!

ps: the code is here now

posted under Bites | No Comments »

Does the code hilite work?


this is gonna be some php code ready fools?

and this should be javascript

ProcessButton= new Class({

	Extends : Widget.Button,

	initialize : function(element, click, options) {

		this.parent(element, click);

		this.options = $extend({

			ready : 'btn.add',

			processing : 'btn.close',

			done : 'btn.done'




	setState : function(state, text) {

		this._setText(state, text);


	_setText : function(state, text) {

		this.state = state;

		if (text) this.options[this.state] = text;



	click : function() {

		if (this.state == ProcessButton.States.done) return;

		var states = ProcessButton.States;

		this._setText(states[((this.state == states.ready)?'processing':'ready')]);



	done : function() {



posted under Bites | No Comments »