Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Searches and fetches GIFs from the Tenor API, with PowerShell and Python examples, using a TENOR_API_KEY environment variable.
83% 96%+13 ptsof test cases passed
Passed 23 of 24 test cases with the skill, and 20 of 24 without it.
3 of 3 safety checks passed
Not used yet
Search and fetch GIFs using the Tenor API. Obtain a free API key at
https://developers.google.com/tenor/guides/quickstart (takes 2 minutes) and set it as
the TENOR_API_KEY environment variable. All examples below use $env:TENOR_API_KEY
(PowerShell) or os.environ["TENOR_API_KEY"] (Python).
function Search-Gif($query, $limit = 5) {
$q = [Uri]::EscapeDataString($query)
$url = "https://tenor.googleapis.com/v2/search?q=$q&limit=$limit&key=$env:TENOR_API_KEY"
$resp = Invoke-RestMethod -Uri $url
$resp.results | ForEach-Object {
[PSCustomObject]@{
Title = $_.title
GifUrl = $_.media_formats.gif.url
PreviewUrl = $_.media_formats.tinygif.url
}
}
}
# Usage
Search-Gif "excited celebration" | Format-Table -AutoSize
import requests, urllib.parse
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.