Fix for the sketchy Yahoo API#115
Fix for the sketchy Yahoo API#115michael-elbert wants to merge 2 commits intoatomizer:masterfrom michael-elbert:master
Conversation
PLEASE review my code. It works but I'm afraid it's a bit hacky.
| } | ||
|
|
||
|
|
||
| var x2js = new X2JS(); |
There was a problem hiding this comment.
I don't see where this is coming from
| return | ||
| } | ||
|
|
||
| /* |
There was a problem hiding this comment.
please don't leave commented code, version control exists for a reason
| complete: function(result){ | ||
| var jsonResult = x2js.xml_str2json(result.responseText); | ||
| //console.log(JSON.stringify(jsonResult)); | ||
| callback(jsonResult); |
There was a problem hiding this comment.
you changed the type of the argument that is passed to callback (it used to be the xhr object) and didn't fix all instances where this function is used (namely the migrate/progress call in mule.js)
| @@ -1,3 +1,4 @@ | |||
|
|
|||
There was a problem hiding this comment.
all of the whitespace changes are uncalled for. also use tabs for indentation (in all the other places)
| } else { | ||
| data.query.results.Chars = d | ||
| } | ||
|
|
There was a problem hiding this comment.
These switches are presumably for compatibility with yql? If you intend to have it as a fallback, actually do it.
| if (this.overlay) this.overlay.hide() | ||
|
|
||
| var d = data.query.results.Chars | ||
| console.log(data); |
| rld.text('\u21bb') | ||
| if (mule.data) { | ||
| var updated = new Date(mule.data.query.created) | ||
| var updated = new Date(mule.data.created) |
There was a problem hiding this comment.
the query object and it's created property are inherent to the yql api. With your changes this is same as new Date() which is not correct if loading from cache. You need to set this timestamp yourself after updating.
|
Like I said, it was just a hacky example of getting rid of YQL, not intended to be shipped out immediately. I didn't mean to leave my code so ugly but I just wanted you to see an alternative. I didn't exactly go through the entire code to look for syntax, I was just trying to make it workable. I'm not the greatest at just picking up a project out of the blue and making glorious edits, sorry about that. But yeah, I just wanted to give an example of life without the Yahoo API. |
PLEASE review my code. It works but I'm afraid it's a bit hacky.