KiberInfinity

Untitled

Nov 30th, 2021
828
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Базовая инфа:
  2.  
  3. console.log(JSON.stringify(await kahaki.getPreview("https://www.npmjs.com/package/tracking-params"), "", "  "))
  4. {
  5.   "title": "tracking-params",
  6.   "description": "Easily get and remove unwanted tracking parameters from URLs.",
  7.   "image": "https://static.npmjs.com/338e4905a2684ca96e08c7780fc68412.png"
  8. }
  9.  
  10. console.log(JSON.stringify(await kahaki.getPreview("https://github.com/medartus/kahaki"), "", "  "))
  11. {
  12.   "title": "GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  13.   "description": "💻 Get metadata, jsonld and url preview from any webpage.  - GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  14.   "image": "https://opengraph.githubassets.com/81053e5c7cd4893a193655599f58f3acddbcabd0a29b372f76cb18d8efb5cca0/medartus/kahaki"
  15. }
  16.  
  17. console.log(JSON.stringify(await kahaki.getPreview("https://vk.com/id1"), "", "  "))
  18. {
  19.   "title": "Pavel Durov",
  20.   "description": "Telegram",
  21.   "image": "http://sun9-20.userapi.com/s/v1/if1/6EUjC-GjCUzvLsnEOGPh4kUkBSR2k9S8jbT7FOQdwfS6f10kw_BYyIS9I7CwyQndVXOUq7Fl.jpg?size=400x452&quality=96&crop=35,30,897,1014&ava=1"
  22. }
  23.  
  24.  
  25.  
  26. // Расширенная инфа о страницах:
  27.  
  28. console.log(JSON.stringify(await kahaki.getAllMetadata("https://www.npmjs.com/package/tracking-params"), "", "  "))
  29. {
  30.   "charset": "utf-8",
  31.   "cleartype": "on",
  32.   "apple-mobile-web-app-capable": "yes",
  33.   "viewport": "width=device-width,minimum-scale=1.0,initial-scale=1,user-scalable=yes",
  34.   "og:image": "https://static.npmjs.com/338e4905a2684ca96e08c7780fc68412.png",
  35.   "msapplication-TileColor": "#cb3837",
  36.   "msapplication-TileImage": "https://static.npmjs.com/7a7ffabbd910fc60161bc04f2cee4160.png",
  37.   "msapplication-config": "https://static.npmjs.com/668aac888e52ae13cac9cfd71fabd31f.xml",
  38.   "theme-color": "#cb3837",
  39.   "description": "Easily get and remove unwanted tracking parameters from URLs.",
  40.   "og:description": "Easily get and remove unwanted tracking parameters from URLs.",
  41.   "og:title": "tracking-params",
  42.   "og:url": "https://www.npmjs.com/package/tracking-params",
  43.   "og:site_name": "npm",
  44.   "keywords": "parameters,query,querystring,referral,tracking,url,utm",
  45.   "twitter:card": "summary",
  46.   "twitter:url": "https://www.npmjs.com/package/tracking-params",
  47.   "twitter:title": "npm: tracking-params",
  48.   "twitter:description": "Easily get and remove unwanted tracking parameters from URLs."
  49. }
  50.  
  51. console.log(JSON.stringify(await kahaki.getAllMetadata("https://vk.com/id1"), "", "  "))
  52. {
  53.   "X-UA-Compatible": "IE=edge",
  54.   "content-type": "text/html; charset=windows-1251",
  55.   "origin-trial": "AiymFI85w2/GSGbzrplgUbWCwiuDfQeTCHPPgkPyHNNKBwYayXHKnxa3pfWYRSqBJSDavyxBmG9yNNKv2edogw4AAABceyJvcmlnaW4iOiJodHRwczovL3ZrLmNvbTo0NDMiLCJmZWF0dXJlIjoiV2ViQ29kZWNzIiwiZXhwaXJ5IjoxNjM4NDAzMTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0=",
  56.   "refresh": "0; URL=/badbrowser.php",
  57.   "og:image": "http://sun9-20.userapi.com/s/v1/if1/6EUjC-GjCUzvLsnEOGPh4kUkBSR2k9S8jbT7FOQdwfS6f10kw_BYyIS9I7CwyQndVXOUq7Fl.jpg?size=400x452&quality=96&crop=35,30,897,1014&ava=1",
  58.   "og:image:secure_url": "https://sun9-20.userapi.com/s/v1/if1/6EUjC-GjCUzvLsnEOGPh4kUkBSR2k9S8jbT7FOQdwfS6f10kw_BYyIS9I7CwyQndVXOUq7Fl.jpg?size=400x452&quality=96&crop=35,30,897,1014&ava=1",
  59.   "og:image:width": "400",
  60.   "og:image:height": "400",
  61.   "og:title": "Pavel Durov",
  62.   "og:description": "Telegram",
  63.   "og:url": "https://vk.com/id1",
  64.   "og:site_name": "VK",
  65.   "og:type": "profile"
  66. }
  67.  
  68. console.log(JSON.stringify(await kahaki.getAllMetadata("https://github.com/medartus/kahaki"), "", "  "))
  69. {
  70.   "charset": "utf-8",
  71.   "viewport": "width=device-width",
  72.   "description": "💻 Get metadata, jsonld and url preview from any webpage.  - GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  73.   "fb:app_id": "1401488693436528",
  74.   "apple-itunes-app": "app-id=1477376905",
  75.   "twitter:image:src": "https://opengraph.githubassets.com/81053e5c7cd4893a193655599f58f3acddbcabd0a29b372f76cb18d8efb5cca0/medartus/kahaki",
  76.   "twitter:site": "@github",
  77.   "twitter:card": "summary_large_image",
  78.   "twitter:title": "GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  79.   "twitter:description": "💻 Get metadata, jsonld and url preview from any webpage.  - GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  80.   "og:image": "https://opengraph.githubassets.com/81053e5c7cd4893a193655599f58f3acddbcabd0a29b372f76cb18d8efb5cca0/medartus/kahaki",
  81.   "og:image:alt": "💻 Get metadata, jsonld and url preview from any webpage.  - GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  82.   "og:image:width": "1200",
  83.   "og:image:height": "600",
  84.   "og:site_name": "GitHub",
  85.   "og:type": "object",
  86.   "og:title": "GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  87.   "og:url": "https://github.com/medartus/kahaki",
  88.   "og:description": "💻 Get metadata, jsonld and url preview from any webpage.  - GitHub - medartus/kahaki: 💻 Get metadata, jsonld and url preview from any webpage.",
  89.   "request-id": "CA8E:8D26:C6D4FB:E14F66:61A51797",
  90.   "html-safe-nonce": "f4e706e219a7bb7ad4ddec7c03924f9d1993a63a6e4a5b42296efe1f1e79daa0",
  91.   "visitor-payload": "eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQThFOjhEMjY6QzZENEZCOkUxNEY2Njo2MUE1MTc5NyIsInZpc2l0b3JfaWQiOiIzMjk3NTEwNTI2Njc2MTc4ODM5IiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=",
  92.   "visitor-hmac": "387c2c8929e5ddb4af5ed8d3dd575669ef22407d559232c06bfb57958996755b",
  93.   "hovercard-subject-tag": "repository:255989429",
  94.   "github-keyboard-shortcuts": "repository",
  95.   "selected-link": "repo_source",
  96.   "google-site-verification": "GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc",
  97.   "octolytics-url": "https://collector.githubapp.com/github/collect",
  98.   "analytics-location": "/<user-name>/<repo-name>",
  99.   // ...
  100. }
RAW Paste Data