Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Writing Code

Suraj Sahani surajsahani

:octocat:
Writing Code
View GitHub Profile
@surajsahani
surajsahani / KotlinInvadersActivity.kt
Created Jan 12, 2020 — forked from EliteIntegrity/KotlinInvadersActivity.kt
The completed KotlinInvadersActivity class
View KotlinInvadersActivity.kt
package com.gamecodeschool.kotlininvaders
import android.app.Activity
import android.graphics.Point
import android.os.Bundle
class KotlinInvadersActivity : Activity() {
// kotlinInvadersView will be the view of the game
// It will also hold the logic of the game
View gist:3a305e736cbf2675238e3a1c25c4591d
#!/usr/bin/python3
import json as js
import urllib.request
choice=1
def grabNews(source,sort,apikey):
url=' https://newsapi.org/v1/articles?'+'source='+source+'&sortBy='+sort+'&apikey='+apikey
# print(url)
data=urllib.request.urlopen(url).read().decode('utf-8')
newsdata = js.loads(data)
return newsdata