online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
from urllib.request import urlopen import json import csv # Get search results response = urlopen("https://youtube.googleapis.com/youtube/v3/search?part=snippet&order=relevance&maxResults=50&regionCode=US&q=surfing&type=video&key=AIzaSyATjKAaTmkKCMo7i6Tqc8aDsdPt1M7fVMU&alt=json") data = json.loads(response.read()) # Gather video ids ids = "" for v in data["items"]: ids += v["id"]["videoId"] + "," # Get statistics on gathered videos response = urlopen("https://www.googleapis.com/youtube/v3/videos/?id=" + ids[:-1] + "&part=snippet,statistics&key=AIzaSyATjKAaTmkKCMo7i6Tqc8aDsdPt1M7fVMU&alt=json") cs = response.headers.get_content_charset() data = json.loads(response.read()) # Write to CSV f = open("data.csv", newline="\n", encoding=cs, mode="w") w = csv.writer(f) w.writerow(["video ID", "title" , "no of views", "no of likes", "no of comments"]) for v in data["items"]: row = [v["id"], v["snippet"]["title"]] row.append(v["statistics"]["viewCount"] if "viewCount" in v["statistics"] else 0) row.append(v["statistics"]["likeCount"] if "likeCount" in v["statistics"] else 0) row.append(v["statistics"]["commentCount"] if "commentCount" in v["statistics"] else 0) w.writerow(row) f.close()

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue