
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
github.com/ei09010/news-api-go
News API is a simple HTTP REST API for searching and retrieving live articles from all over the web. It can help you answer questions like:
You can search for articles with any combination of the following criteria:
You can sort the results in the following orders:
You need an API key to use the API - this is a unique key that identifies your requests. They're free for development, open-source, and non-commercial use. You can get one here: https://newsapi.org.
The News API client library is available on GitHub, just need to run the following command:
go get https://github.com/ei09010/News-API-go
package main
import (
"News-API-go/models"
"News-API-go/constants"
"News-API-go/client"
"fmt"
)
// Example request
var newsClient = client.NewClient("https://newsapi.org", "XXXXXXXXXXXXXXXXXXXXXXXXXXXX")
func main(){
topHeadlineRequest := models.TopHeadlinesRequest{
Category: constants.Business,
Country: constants.US,
Language: "EN",
}
response, err := newsClient.GetTopHeadlines(topHeadlineRequest)
if err != nil{
fmt.Println(err)
}
fmt.Println("we had the following result amount: ", response.TotalResults)
for _, article := range response.Articles{
fmt.Println(article.SourceName)
fmt.Println(article.Author)
fmt.Println(article.Title)
fmt.Println(article.Description)
fmt.Println(article.Url)
fmt.Println(article.UrlToImage)
fmt.Println(article.PublishedAt)
fmt.Println(`
*******************
`)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.