
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Redd is a batteries-included API wrapper for reddit.
require 'redd'
session = Redd.it(
user_agent: 'Redd:RandomBot:v1.0.0 (by /u/Mustermind)',
client_id: 'PQgS0UaX9l70oQ',
secret: 'PsF_kVZrW8nSVCG5kNsIgl-AaXE',
username: 'RandomBot',
password: 'hunter2'
)
session.subreddit('all').comments.stream do |comment|
if comment.body.include?('roll a dice')
comment.reply("It's a #{rand(1..6)}!")
elsif comment.body.include?('flip a coin')
comment.reply("It's a #{%w(heads tails).sample}!")
end
end
require 'sinatra'
require 'redd/middleware'
use Rack::Session::Cookie
use Redd::Middleware,
user_agent: 'Redd:Username App:v1.0.0 (by /u/Mustermind)',
client_id: 'PQgS0UaX9l70oQ',
secret: 'PsF_kVZrW8nSVCG5kNsIgl-AaXE',
redirect_uri: 'http://localhost:4567/auth/reddit/callback',
scope: %w(identity),
via: '/auth/reddit'
get '/' do
reddit = request.env['redd.session']
if reddit
"Hello /u/#{reddit.me.name}! <a href='/logout'>Logout</a>"
else
"<a href='/auth/reddit'>Sign in with reddit</a>"
end
end
get '/auth/reddit/callback' do
redirect to('/') unless request.env['redd.error']
"Error: #{request.env['redd.error'].message} (<a href='/'>Back</a>)"
end
get '/logout' do
request.env['redd.session'] = nil
redirect to('/')
end
Yes, that's all there is to it! You don't need to handle rate-limiting, refresh access tokens or protect against issues on reddit's end (like 5xx errors).
Check out the official subreddit or raise a GitHub issue.
Take a look at CONTRIBUTING.md.
FAQs
Unknown package
We found that spinels-redd 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.