Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/chrizpy/twingly-search-api-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/chrizpy/twingly-search-api-go

  • v0.0.0-20211103164753-9f98e1c83271
  • Source
  • Go
  • Socket score

Version published
Created
Source

Twingly Search API Go

A Go package for Twingly's Blog Search API. Twingly is a blog search service that provides a searchable API known as Twingly Blog Search API

I did this for fun to try and learn the Go language, figured it was a good idea to have some sort of project alongside my Go journey.

Installation

Import the package into your code:

import (
    twinglySearchClient "github.com/chrizpy/twingly-search-api-go"
)

func main(){
    ...
}

And install it.

go get github.com/chrizpy/twingly-search-api-go

Usage

The twingly-search package talks to a commercial API and requires an API key. Set the TWINGLY_SEARCH_KEY environment variable to the obtained key.

To learn more about the capabilities of Twingly's APIs, please read the Blog Search API documentation.

Blog Search API

package main

import (
    "encoding/json"
    "fmt"
    "os"

    twinglySearchClient "github.com/twingly/twingly-search-api-go"
)

func main() {
    client, _ := twinglySearchClient.New()
    client.SetUserAgent("MyCompany/1.0")
    client.AddQuery("cop26 page-size:1")


    response, _ := client.ExecuteQuery()
}

Requirements

  • API key, sign up via twingly.com to get one
  • Go >= 1.17 (Earlier versions probably work, just developed at 1.17)

Development

Tests

Run all tests

go test ./...

TODO

This package is still very much in its infancy and could be lacking features compared to its sibling libraries

FAQs

Package last updated on 03 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc