This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
from dash.dependencies import Input, Output | |
import plotly.plotly as py | |
import plotly.graph_objs as go | |
from flask import Flask | |
import random | |
import datetime | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Only extract: Name, Owner's login, html_url and score | |
The nested part of Owner got me. | |
{code} | |
keys_to_extract = ['name', 'html_url', 'stargazers_count'] | |
json_trimmed = json['items'].map do |v| | |
v.select { |k, _| keys_to_extract.include? k } | |
#v.dig('owner', 'login') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'parallel' | |
require 'rest-client' | |
require 'json' | |
class Star < ApplicationRecord | |
include ActiveModel::Serializers::JSON | |
BASE_URL = 'https://api.github.com/search/repositories?q=' | |
STARS = '1..2000' | |
DATE = Time.now.strftime('%Y-%m-%d') |