claytongentry / furlex

A structured data extraction tool written in Elixir
https://hex.pm/packages/furlex
Other
44 stars 18 forks source link

Add request status result response #6

Closed abitdodgy closed 6 years ago

abitdodgy commented 6 years ago

When you unfurl a URL and receive a 404 page, there should be a way of knowing. Here's an example response from Shopify's 404. There's no obvious way of knowing that the original URL does not exist. Ideally, shouldn't we include something status code in the response?

{  
   "twitter":{  
      "twitter:site":"@"
   },
   "other":{  
      "viewport":"width=device-width, initial-scale=1",
      "shopify-digital-wallet":"/6583535/digital_wallets/dialog"
   },
   "oembed":null,
   "json_ld":[  

   ],
   "facebook":{  
      "og:url":"",
      "og:type":"website",
      "og:title":"404 – Não Encontrado",
      "og:site_name":"Baby Bits",
      "og:image:secure_url":"https://cdn.shopify.com/s/files/1/0658/3535/t/21/assets/logo.png?13228126900977669896",
      "og:image":"http://cdn.shopify.com/s/files/1/0658/3535/t/21/assets/logo.png?13228126900977669896"
   },
   "canonical_url":""
}
claytongentry commented 6 years ago

Good call. This should do it. https://github.com/claytongentry/furlex/pull/7

claytongentry commented 6 years ago

I've published 0.2.1 with these changes. Thanks again!