Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
orgasmatron
Advanced tools
Readme
A simple easy to use HTML head scraper that provides a clean interface for extracting data from the tags within the head
tag.
Wikipedia - The Orgasmatron is a manually operated head massage device made of partially flexible copper wires attached to a handle. The device has been specifically designed to gently massage the head and the back of the neck.
The usage is simple and familiar. Just provide a url and callback function and it will be supplied with an accessor object that you can use to extract head tags.
var scraper = require('orgasmatron');
scraper('http://www.google.com', function(err, bundle){
bundle.findWhere('meta', {name: 'description'});
});
The above looks for the first meta tag that has an attribute called name set to the value 'description'. In this case you would get back the object:
{ content: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
name: 'description' }
npm install orgasmatron
The require call returns a function that expects a url string and a callback function.
The callback function takes two parameters, (err, bundle)
where bundle is an accessor object for finding head tags.
The data bundle provides methods for accessing data.
Returns a list of all element objects that have the same tag string as the argument tag
, and matches the attributes object. The attributes object defines attribute keys that must exist, as well as the values that must match them. If an attribute key is provided but the value is null
or undefined
, the attribute is checked to exist, but the value may be any value.
Returns the first element object that matches using the same criterion of .where
.
<meta property="og:type" content="website" />
<meta property="og:title" content="My First Website" />
<meta property="og:description" content="This is my first website, I hope you enjoy!" />
If you want to match any meta tag that has the content
attribute set you can call the .where
method with the key defined with no value in the attributes object.
bundle.where('meta', {content: undefined});
That would return all meta tags with a content
attribute.
[{property: 'og:type', content: 'website'},
{property: 'og:title' content: 'My First Website'},
{property: 'og:description' content: 'This is my first website, I hope you enjoy!'}]
If you only wanted meta tags with property
set to og:title
, you would provide an attribute object with a key property
set to the string og:title
. Using findWhere would stop looking after finding the first element that matches.
bundle.findWhere('meta', {property: 'og:title'});
That would only return the first meta tag with a an attribute of property
set to og:title
.
{property: 'og:title' content: 'My First Website'}
FAQs
Easily scrape websites for html header meta data
The npm package orgasmatron receives a total of 1 weekly downloads. As such, orgasmatron popularity was classified as not popular.
We found that orgasmatron 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.