coleifer / micawber

a small library for extracting rich content from urls
http://micawber.readthedocs.org/
MIT License
632 stars 91 forks source link

fixed https reg exp for flicker #32

Closed sammyrulez closed 10 years ago

sammyrulez commented 10 years ago

flicker now expose shortened url with https and the regexp of the provider do not match

coleifer commented 10 years ago

I did a quick experiment by combining:

In every case flickr returned https data:

{
  "provider_url": "https://www.flickr.com/", 
  "cache_age": 3600, 
  "version": "1.0", 
  "license": "All Rights Reserved", 
  "title": "Kubricks", 
  "url": "https://farm6.staticflickr.com/5575/14848501055_0527527a17_b.jpg", 
  "author_name": "James_Burden", 
  "height": "683", 
  "thumbnail_width": 75, 
  "width": "1024", 
  "thumbnail_url": "https://farm6.staticflickr.com/5575/14848501055_0527527a17_s.jpg", 
  "author_url": "https://www.flickr.com/photos/macthemesdj/", 
  "web_page": "https://www.flickr.com/photos/macthemesdj/14848501055/", 
  "license_id": 0, 
  "thumbnail_height": 75, 
  "web_page_short_url": "https://flic.kr/p/oC7s3T", 
  "type": "photo", 
  "provider_name": "Flickr"
}

So I think it's safe to just make the endpoint reference https and make the regex permissive.

coleifer commented 10 years ago

Fixed in 73614fae15ce10013d2541f21e72bb1d77425613