https://github.com/zigomir/imageornot
Stupid simple service to verify if URL leads to image or not
https://github.com/zigomir/imageornot
Last synced: 11 months ago
JSON representation
Stupid simple service to verify if URL leads to image or not
- Host: GitHub
- URL: https://github.com/zigomir/imageornot
- Owner: zigomir
- Created: 2014-10-13T16:53:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-02T06:24:30.000Z (almost 11 years ago)
- Last Synced: 2025-03-01T00:14:14.852Z (over 1 year ago)
- Language: Ruby
- Size: 145 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageOrNot
## Setup
```bash
bundle
rackup
```
## Example
```js
var urlToTest = 'http://www.picturesnew.com/media/images/image-background.jpg';
var request = new XMLHttpRequest();
request.open('POST', 'http://localhost:9292', true);
request.setRequestHeader('Content-type', 'application/json')
request.onreadystatechange = function() {
if (request.readyState != 4 || request.status != 200) return;
var result = JSON.parse(request.responseText);
if (result.is_image) {
} else {
}
};
request.send(JSON.stringify({ url: urlToTest }));
```
## Motivation
I need CORS enabled service that will tell if URL leads to image or not.