diff --git a/README.md b/README.md
index eb64be0..ced6581 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ A set of useful apis
* express
* js-video-url-parser
* qrcode-svg
+* object-hash
## Inside but not in use
@@ -33,7 +34,21 @@ response:
* json
-### see samples file or below
+
+## SHA/MD5 hashes
+
+```http
+https://polarpod.herokuapp.com/apis/hasher?d=[data]&m=[MD5|SHA]
+```
+
+parameters
+
+* d: data
+* m: hash algorithm
+
+responses
+
+* json
## SVG QR Code generator
@@ -149,6 +164,26 @@ _for vimeo thumbails the image size '_640' is replaced by '_1920'_
}
```
+## hasher
+
+```json
+ succesfull (status 200)
+ {
+ "type":"sha",
+ "original":"test",
+ "hash":"8d56ea07e4ac6175807ed5f66279715d394d8885",
+ "success":true
+ }
+
+ failed (status 400)
+ {
+ "type":"sha",
+ "original":"test",
+ "hash":"",
+ "success":false
+ }
+```
+
## Modules credits
[qrcode-svg by papnkukn](https://github.com/papnkukn/qrcode-svg)
@@ -161,6 +196,8 @@ _for vimeo thumbails the image size '_640' is replaced by '_1920'_
[metafetch by brahma-dev](https://github.com/brahma-dev/metafetch)
+[object-hash by addaleax](https://github.com/puleos/object-hash)
+
## LICENSE
* MIT
diff --git a/index.js b/index.js
index 7db6bb0..0d61ff1 100644
--- a/index.js
+++ b/index.js
@@ -4,6 +4,8 @@
*
* @author Matsukii
*
+ * facebook embed video plugin url
+ * https://www.facebook.com/plugins/video.php?href=
*
* * Og tag getter
* https://polarpod.herokuapp.com/apis/ogtags?u=[url]
@@ -25,6 +27,8 @@ const path = require('path');
const cors = require('cors')
const conf = require('./src/config');
+const test = require('./src/facebookVideoUrlParser');
+test();
// 0ac6kh - 1abz19
const hasher = require('object-hash');
diff --git a/other/452001751_1920.jpg b/other/452001751_1920.jpg
new file mode 100644
index 0000000..1a461a5
Binary files /dev/null and b/other/452001751_1920.jpg differ
diff --git a/other/452001751_9000.jpg b/other/452001751_9000.jpg
new file mode 100644
index 0000000..15e2ac9
Binary files /dev/null and b/other/452001751_9000.jpg differ
diff --git a/other/Thumbs.db b/other/Thumbs.db
new file mode 100644
index 0000000..7cf87af
Binary files /dev/null and b/other/Thumbs.db differ
diff --git a/other/fbVideoUrls.txt b/other/fbVideoUrls.txt
new file mode 100644
index 0000000..db1cd93
--- /dev/null
+++ b/other/fbVideoUrls.txt
@@ -0,0 +1,10 @@
+https://qz.com/1234502/how-to-block-facebook-all-the-urls-you-need-to-block-to-actually-stop-using-facebook/
+
+https://www.facebook.com/felipe.abruzzesi/videos/697600310738165/?t=4
+https://www.facebook.com/felipe.abruzzesi/videos/697600310738165/?t=4
+https://www.fb.com/felipe.abruzzesi/videos/697600310738165/?t=4
+
+
+[http] site home user vieo catg video id start time
+https://www. fb.com/ felipe.abruzzesi/ videos/ 697600310738165/ ?t=4
+
diff --git a/other/vimeo.json b/other/vimeo.json
new file mode 100644
index 0000000..5b72e7c
--- /dev/null
+++ b/other/vimeo.json
@@ -0,0 +1 @@
+[{"id":76979871,"title":"The New Vimeo Player (You Know, For Videos)","description":"It may look (mostly) the same on the surface, but under the hood we totally rebuilt our player. Here\u2019s a quick rundown of some of the coolest new features:
\r\n
\r\n\u2022 Lightning fast playback
\r\n\u2022 Redesigned Share screen
\r\n\u2022 Closed caption and subtitle compatible
\r\n\u2022 HTML5 by default
\r\n\u2022 Purchase-from-player functionality for embedded Vimeo On Demand trailers
\r\n\u2022 More responsive than ever (go ahead, resize it, we dare you!!!)
\r\n
\r\nWe\u2019re really proud of these updates. So proud that we made a spiffy new page to showcase all the reasons why we have the best video player in the galaxy. Check it out here: http:\/\/vimeo.com\/player
\r\n
\r\nIn short, this is a player that even haters can love.","url":"https:\/\/vimeo.com\/76979871","upload_date":"2013-10-15 14:08:29","mobile_url":"https:\/\/vimeo.com\/76979871","thumbnail_small":"https:\/\/i.vimeocdn.com\/video\/452001751_100x75.webp","thumbnail_medium":"https:\/\/i.vimeocdn.com\/video\/452001751_200x150.webp","thumbnail_large":"https:\/\/i.vimeocdn.com\/video\/452001751_640.webp","user_id":152184,"user_name":"Vimeo Staff","user_url":"https:\/\/vimeo.com\/staff","user_portrait_small":"https:\/\/i.vimeocdn.com\/portrait\/9934446_30x30.webp","user_portrait_medium":"https:\/\/i.vimeocdn.com\/portrait\/9934446_75x75.webp","user_portrait_large":"https:\/\/i.vimeocdn.com\/portrait\/9934446_100x100.webp","user_portrait_huge":"https:\/\/i.vimeocdn.com\/portrait\/9934446_300x300.webp","duration":62,"width":1280,"height":720,"tags":"","embed_privacy":"anywhere"}]
\ No newline at end of file
diff --git a/other/vimeo.xml b/other/vimeo.xml
new file mode 100644
index 0000000..8e85774
--- /dev/null
+++ b/other/vimeo.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/facebookVideoUrlParser.js b/src/facebookVideoUrlParser.js
new file mode 100644
index 0000000..b9c150b
--- /dev/null
+++ b/src/facebookVideoUrlParser.js
@@ -0,0 +1,8 @@
+module.exports = (url = false) => {
+ let a = "aaa/bbb/ccc";
+ let reg = new RegExp('\/[a-z]{1,}\/');
+ console.log(reg.exec(a));
+
+
+
+};
diff --git a/src/router.js b/src/router.js
index 8cc81c2..13d6c3d 100644
--- a/src/router.js
+++ b/src/router.js
@@ -13,6 +13,7 @@ module.exports = (app, dir) => {
const wordFilter = require('./word-filter');
const resMsgs = require('./responseMessages');
const conf = require('./config');
+ const hasher = require('object-hash');
/**
@@ -186,6 +187,33 @@ module.exports = (app, dir) => {
}
});
+ /**
+ * @description hash function
+ *
+ * params: d = data, m = mode (MD5 or sha1)
+ *
+ * @returns the hash from given data
+ */
+ app.get('/apis/hasher', function(req, res, next){
+ let mode = req.query.m;
+ let dat = req.query.d;
+
+ let mdrgx = new RegExp('MD5', 'gi');
+ let shagx = new RegExp('sha', 'gi');
+ if(mode == ''){
+ mode = 'SHA';
+ }
+ if(mdrgx.test(mode)){
+ return res.status(200).json({type: mode, original: dat, hash: hasher.MD5(dat), success: true});
+ }
+ else if(shagx.test(mode)){
+ return res.status(200).json({type: mode, original: dat, hash: hasher.sha1(dat), success: true})
+ }
+ else{
+ return res.status(400).json({type: mode, original: dat, hash: '', success: false})
+ }
+
+ })
}
\ No newline at end of file