
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
SleepingOwl Apist is a small library which allows you to access any site in api-like style, based on html parsing.
This package allows you to write method like this:
require 'apist'
class WikiApi < Apist
base_url 'http://en.wikipedia.org'
def index
get '/wiki/Main_Page',
welcome_message: filter('#mp-topbanner div:first').text[0...-1],
portals: filter('a[title^="Portal:"]').each(
link: current.attr('href').call(lambda { |href| self.class.base_url + href }),
label: current.text
),
languages: filter('#p-lang li a[title]').each(
label: current.text,
lang: current.attr('title'),
link: current.attr('href').call(lambda { |href| 'http:' + href })
),
sister_projects: filter('#mp-sister b a').each.text,
featured_article: filter('#mp-tfa').html
end
end
use it:
api = WikiApi.new
data = api.index
and get the following result (json format used only for visualization, actual result type is Hash
):
{
"welcome_message": "Welcome to Wikipedia",
"portals": [
{
"link": "http:\/\/en.wikipedia.org\/wiki\/Portal:Arts",
"label": "Arts"
},
{
"link": "http:\/\/en.wikipedia.org\/wiki\/Portal:Biography",
"label": "Biography"
},
...
],
"languages": [
{
"label": "Simple English",
"lang": "Simple English",
"link": "http:\/\/simple.wikipedia.org\/wiki\/"
},
{
"label": "العربية",
"lang": "Arabic",
"link": "http:\/\/ar.wikipedia.org\/wiki\/"
},
{
"label": "Bahasa Indonesia",
"lang": "Indonesian",
"link": "http:\/\/id.wikipedia.org\/wiki\/"
},
...
],
"sister_projects": [
"Commons",
"MediaWiki",
...
],
"featured_article": "<div style=\"float: left; margin: 0.5em 0.9em 0.4em 0em;\">...<\/div>"
}
Add this line to your application's Gemfile:
gem 'apist'
And then execute:
$ bundle
Or install it yourself as:
$ gem install apist
Documentation can be found at sleeping owl apist.
View examples.
You can donate in BTC: 13k36pym383rEmsBSLyWfT3TxCQMN2Lekd
Apist was written by Sleeping Owl and is released under the MIT License. See the LICENSE file for details.
FAQs
Unknown package
We found that apist 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.