daveearley / cli.fyi Goto Github PK
View Code? Open in Web Editor NEWA Potentially Useful Command Line Query Tool
Home Page: https://cli.fyi
License: MIT License
A Potentially Useful Command Line Query Tool
Home Page: https://cli.fyi
License: MIT License
Hi there,
Could you please provide the SSL renew to the website, thank you for this useful,
Best Regards,
Joel Pinheiro
When I do the $ curl cli.fyi/BTC
example request, all I get is :
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.12.1 (Ubuntu)</center>
</body>
</html>
I need to pass the -L
parameter in order to get something.
I think this should be mentioned in the documentation, although it worked without before ๐
Just wanted to make you aware of quicktype, which can generate code from cli.fyi data for using the data in many programming languages.
~ curl cli.fyi/BTC | quicktype -l swift
// To parse the JSON, add this file to your project and do:
//
// let topLevel = try TopLevel(json)
import Foundation
struct TopLevel: Codable {
let type: String
let data: [String: Double]
}
// MARK: Convenience initializers
extension TopLevel {
init(data: Data) throws {
self = try JSONDecoder().decode(TopLevel.self, from: data)
}
init(_ json: String, using encoding: String.Encoding = .utf8) throws {
guard let data = json.data(using: encoding) else {
throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
}
try self.init(data: data)
}
init(fromURL url: URL) throws {
try self.init(data: try Data(contentsOf: url))
}
func jsonData() throws -> Data {
return try JSONEncoder().encode(self)
}
func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
return String(data: try self.jsonData(), encoding: encoding)
}
}
~ curl cli.fyi/github.com | quicktype -l go --top-level DomainInfo
// To parse and unparse this JSON data, add this code to your project and do:
//
// domainInfo, err := UnmarshalDomainInfo(bytes)
// bytes, err = domainInfo.Marshal()
package main
import "encoding/json"
func UnmarshalDomainInfo(data []byte) (DomainInfo, error) {
var r DomainInfo
err := json.Unmarshal(data, &r)
return r, err
}
func (r *DomainInfo) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type DomainInfo struct {
Type string `json:"type"`
Data Data `json:"data"`
}
type Data struct {
DNS []string `json:"dns"`
Whois []string `json:"whois"`
}
~ curl cli.fyi/me | \
quicktype -l csharp --features attributes-only --top-level ClientInfo --density dense \
--namespace CLI.FYI
namespace CLI.FYI
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using J = Newtonsoft.Json.JsonPropertyAttribute;
using R = Newtonsoft.Json.Required;
using N = Newtonsoft.Json.NullValueHandling;
public partial class ClientInfo
{
[J("type")] public string Type { get; set; }
[J("data")] public Data Data { get; set; }
}
public partial class Data
{
[J("iPAddress")] public string IPAddress { get; set; }
[J("userAgent")] public string UserAgent { get; set; }
[J("browser")] public string Browser { get; set; }
[J("iPAddressInfo")] public IPAddressInfo IPAddressInfo { get; set; }
}
public partial class IPAddressInfo
{
[J("organisation")] public string Organisation { get; set; }
[J("country")] public string Country { get; set; }
[J("countryCode")] public string CountryCode { get; set; }
[J("city")] public string City { get; set; }
[J("continent")] public string Continent { get; set; }
[J("latitude")] public string Latitude { get; set; }
[J("longitude")] public string Longitude { get; set; }
}
}
And site is not up
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.