G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 8th, 2020 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Net;
  3. using System.IO;
  4. using Newtonsoft.Json;
  5.                    
  6. public class Program
  7. {
  8.     public static void Main()
  9.     {
  10.         dynamic stuff = JsonConvert.DeserializeObject(Get("https://api.spacexdata.com/v3/launches?rocket_id=falcon9&launch_success=false"));
  11.        
  12.         foreach(string ship in stuff[0].ships) {
  13.             dynamic stuff2 = JsonConvert.DeserializeObject(Get("https://api.spacexdata.com/v3/ships/" + ship));
  14.             Console.WriteLine(stuff2.ship_type);
  15.         }
  16.     }
  17.    
  18.     public static string Get(string uri)
  19.     {
  20.         HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
  21.         request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
  22.  
  23.         using(HttpWebResponse response = (HttpWebResponse)request.GetResponse())
  24.         using(Stream stream = response.GetResponseStream())
  25.         using(StreamReader reader = new StreamReader(stream))
  26.         {
  27.             return reader.ReadToEnd();
  28.         }
  29.     }
  30. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top