Internet Speed Tests on a Raspberry Pi

image

A couple of weeks ago soynerdito soynerdito shared a bot he made to tweet internet connection speed results every now and then.

I then remembered I had a Raspberry Pi I wasn’t using at all. So I built a small app that runs speed tests every 3 hours. It’s based on speedtest-cli which is a Command line interface for testing internet bandwidth using speedtest.net.

Read More

The easiest way to add WebSockets to Django

image

TL;DR - I came up with a very simple solution to handle WebSockets in Django apps. You just install django-websocket-request, run a script and you have WebSockets for your Django app. The cool thing is that this solution makes Django believe its getting a (somewhat) normal HTTP request so you can reuse almost all of you application’s code. Plays nicely with Django REST Framework and with plain function-based views and class-based views. Check out the demo and it’s source code on GitHub.

Read More

Auth with JSON Web Tokens

image

When it comes to implementing authentication on web apps, one solution you’ll definitely hear about first are cookies. Cookie-based authentication uses a server side cookies to authenticate the user on every request. This means that you’ll need to keep a session store, whether it’s on a database or on something like Redis. A solution you’ll probably not hear as often is token-based authentication which relies on a signed token that is sent to the server on each request.

Alberto Pose over at Auth0 wrote a great blog post about Cookie vs Tokens, diagrams how both of these method works, and goes over the benefits of using a token-based approach for authentication.

There’s a relatively new standard called JSON Web Token that happens to be backed by companies like Firebase, Google, Microsoft, and Zendesk. There are already many libraries to handle encoding and decoding of this tokens in the backend.

Read More

The Hacker and Designer News Newsletter

image

After recently building a scraper and web API for The News, I thought  it’d be a cool idea to use that data somehow. First thing that came to mind was to build a newsletter. And so The Hacker and Designer News Newsletter was built.

Newsletter

Every week I’ll send a newsletter with a curated recap of the week’s best articles from Hacker News and Designer News on startups, entrepreneurship, hacks, programming, design, and more. Something I may consider for the new future is allowing people to subscribe to a simple and shorter daily recap.


image

Sponsors

I’ll add your logo, copy, and a link in the top of the newsletter. If you’re interested in sponsoring this newsletter, feel free to send me an email to: hello@jpadilla.com.

Technical stuff

This time I didn’t take advantage of The News and decided to build a new system to collect and aggregate posts from Hacker News using HNSearch and from Designer News using a scraper. HNSearch has a niftee RSS feed that works beautifully and has all the available data. Designer News, on the other hand, has some inconsistency with the data available in the RSS and JSON feeds, so the only way to fetch all the data I wanted was by scraping their site.

Example response data format:

The project/hack is available in GitHub. Star, Watch, Fork at https://github.com/jpadilla/HackerDesignerNews

Scraper and Web API for The News

image

I recently found out about http://thenews.im thanks to @gcollazo. The News is a pretty cool project by ahmetsulek that brings together under one same site LayerVault’s Designer News and Y Combinator’s Hacker News.

I decided to take advantage of having all those posts from two different sources together and built a scraper for it with Node.js. Once I had all the posts stored and updated on my side I thought it’d be cool to implement a JSON endpoint to allow anyone to use the data however they want. 

Example:

Available endpoints:

Data format:

The project/hack is available in GitHub. Star, Watch, Fork at https://github.com/jpadilla/thenews-api

1 2 3 4 5