jasonmayes / Twitter-Post-Fetcher

Fetch your twitter posts without using the new Twitter 1.1 API. Pure JavaScript! By Jason Mayes
http://www.jasonmayes.com/projects/twitterApi
Other
911 stars 233 forks source link

Add extra author info to the dataOnly object #150

Closed coreyaus closed 7 years ago

coreyaus commented 7 years ago

At the moment the dataOnly version returns an author attribute containing an awkward HTML string. This update includes discrete attributes for the author's name, screen_name and profile_url. It adds to the existing data structure without altering it for any users who already depend on the existing author attribute.

PS: Love this tool, and no stress if this change doesn't suit for whatever reason 👍

PPS: This commit currently only edits the standard JS file, not the minified file

jasonmayes commented 7 years ago

Thanks for contributing. I have added some comments about "nil".

coreyaus commented 7 years ago

Perhaps I'm missing something, but I couldn't see any comments - where should I look to review those? Is it just a matter of replacing nil with null or an empty string, or is it more complex? I figured it was useful to include the full object structure even if there is no author (and set each attribute to a nil or empty value in that case). Happy to change as required, and no worries if it's more hassle than it's worth to explain the issues with nil. Cheers

jasonmayes commented 7 years ago

I think my main point is that I have never heard of "nil" before for assignment of an empty value. Its always null or undefined. If you change those to null's then I can merge :-)

coreyaus commented 7 years ago

Fair enough. I think it was a bit of ruby syntax creeping into my JS. I've just made that edit 👍 Thanks mate!

jasonmayes commented 7 years ago

Thanks for contributing!