Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
Fixes to basic test program.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyah Check committed Aug 4, 2017
1 parent e55bede commit fcd240f
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ package main

import (
"fmt"
"io/ioutil"
//"io/ioutil"
"log"
"net/http"

"google.golang.org/api/googleapi/transport"
youtube "google.golang.org/api/youtube/v3"
)

const developerKey = "vqNWDovin1e8vR24HNdxF0_G"
const developerKey = "AIzaSyCZSy5sOGsZrOrI0vLtowf_VJ-tl_USzNE"

func main() {

Expand All @@ -28,20 +28,15 @@ func main() {
}

// Make GET request to Youtube API.
call := service.Videos.List("snippet, contentDetails, fileDetails,liveStreamingDetails")
call := service.Videos.List("snippet, recordingDetails")
call.Id("Ks-_Mh1QhMc")
resp, err := call.Do()
if err != nil {
log.Fatalf("Error making search API call: %v", err)
log.Fatalf("Error getting Video response: %v", err)
}
for _, item := range response.Items {
fmt.Println(item.Id, ": ", item.Snippet.Title)
}
body, err := ioutil.ReadAll(resp)
if err != nil {
fmt.Printf("Error reading output")
return
}

fmt.Printf("\nGot %d bytes answer", len(body))
for cnt, item := range resp.Items {
fmt.Printf("\n %d: %+v\n", cnt, item)
}

return
}

0 comments on commit fcd240f

Please sign in to comment.