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
910 stars 234 forks source link

Support multiple images #177

Closed mpellegrin closed 6 years ago

mpellegrin commented 6 years ago

The regex in extractImageUrl was only handling one image per post (only the first image, even if an image grid is included).

This fix sets the matching on multiple images, and extracts each URLs, while keeping the backward compatibility for the "dataonly" mode that is expecting only one image in the 'image' variable.

It should probably be refined to mark when more than one image is loaded, and to prevent multiple call to extractImagesUrl if not necessary.

mpellegrin commented 6 years ago

Well, I forgot to update the minified version, I hope it is ok.

jasonmayes commented 6 years ago

Thanks for submitting. Shall take a look.

jasonmayes commented 6 years ago

LGTM thank you for your contribution!