
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
phonghng-url-kw-extractor
Advanced tools
Support over 60 languages and if you want to add more language, just add their stopwords in stopwords.json
Install via npm
:
npm install phonghng-url-kw-extractor
Let's code:
var uke = require("phonghng-url-kw-extractor");
/* Extract keyword from url */
var url = "https://example.com",
onload_event = false; // see the note below this code
uke.get_keyword(url, onload_event, keywords => {
console.log(keywords); //return an object with keywords and scores
});
/* Extract keyword from html */
var html = "your html here - includes doctype, html, head, body tags",
onload_event = false; // see the note below this code
uke.get_keyword_from_html(html, onload_event, keywords => {
console.log(keywords); // return an object with keywords and scores
});
/* Extract keyword from string */
var html = "Việt Nam, tên gọi chính thức là Cộng hòa Xã hội chủ nghĩa Việt Nam, là quốc gia nằm ở cực Đông của bán đảo Đông Dương thuộc khu vực Đông Nam Á, giáp với Lào, Campuchia, Trung Quốc, Biển Đông và vịnh Thái Lan. Quốc gia này có chung đường biên giới trên biển với Thái Lan qua vịnh Thái Lan và với Trung Quốc, Philippines, Indonesia, Brunei, Malaysia qua Biển Đông. Việt Nam có diện tích 331.212 km², đường biên giới trên đất liền dài 4.639 km, đường bờ biển trải dài 3.260 km, dân số ước tính vào khoảng 98 triệu người với 54 dân tộc trong đó người Kinh chiếm đa số. Thủ đô của Việt Nam là thành phố Hà Nội, thành phố đông dân cũng như có quy mô GRDP lớn nhất là Thành phố Hồ Chí Minh (ngày nay vẫn thường được gọi phổ biến với tên cũ là Sài Gòn).";
uke.get_keyword_from_string(string, keywords => {
console.log(keywords); // return an array with keywords
});
onload_event: Set to true
if you want to set keyword (from url/html) "only when" the page is loaded. See this Stack Overflow answer for "load event"
Note: We using Heroku to host this API, and Heroku is limit 4500 requests per hour (or about 1.25 request per seconds). So, don't send request if it's not necessary! By the way, Heroku limit request timeout is "only 30s" so the "onload_event" (as above) is always be false
. Tip: If your website take longer than 30s to load, try to get its HTML and use the "Extract keyword from HTML" API
/* ------------
| Using jQuery |
------------- */
/* Extract keyword from url */
$.post("https://uke-api.herokuapp.com/kwurl", { url: "https://example.com" }, keywords => {
console.log(keywords);
});
/* Extract keyword from html */
$.post("https://uke-api.herokuapp.com/kwhtml", { html: "your html here - includes doctype, html, head, body tags" }, keywords => {
console.log(keywords);
});
/* (Not recommend) Extract keyword from string */
$.post("https://uke-api.herokuapp.com/kwstring", { string: "Việt Nam, tên gọi chính thức là Cộng hòa Xã hội chủ nghĩa Việt Nam, là quốc gia nằm ở cực Đông của bán đảo Đông Dương thuộc khu vực Đông Nam Á, giáp với Lào, Campuchia, Trung Quốc, Biển Đông và vịnh Thái Lan. Quốc gia này có chung đường biên giới trên biển với Thái Lan qua vịnh Thái Lan và với Trung Quốc, Philippines, Indonesia, Brunei, Malaysia qua Biển Đông. Việt Nam có diện tích 331.212 km², đường biên giới trên đất liền dài 4.639 km, đường bờ biển trải dài 3.260 km, dân số ước tính vào khoảng 98 triệu người với 54 dân tộc trong đó người Kinh chiếm đa số. Thủ đô của Việt Nam là thành phố Hà Nội, thành phố đông dân cũng như có quy mô GRDP lớn nhất là Thành phố Hồ Chí Minh (ngày nay vẫn thường được gọi phổ biến với tên cũ là Sài Gòn). Việt Nam tuyên bố chủ quyền đối với hai thực thể địa lý tranh chấp trên Biển Đông là các quần đảo Hoàng Sa (nhưng không kiểm soát trên thực tế) và Trường Sa (kiểm soát một phần)" }, response => {
console.log(response.keywords);
});
FAQs
Extract keyword from any url in many languages
The npm package phonghng-url-kw-extractor receives a total of 5 weekly downloads. As such, phonghng-url-kw-extractor popularity was classified as not popular.
We found that phonghng-url-kw-extractor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.