yetibot / yetibot.github.io

🕸 Source for yetibot.com built on Cryogen
https://yetibot.com
3 stars 4 forks source link

Add some scraper / json / render examples #36

Open devth opened 5 years ago

devth commented 5 years ago
!alias random_advice="json https://api.adviceslip.com/advice | json path $.slip.advice"
devth commented 5 years ago

How do we get the question & the answer?

!json https://opentdb.com/api.php?amount=10 | json path $.results.[*].question

Could render help?

devth commented 5 years ago
!json https://api.tronalddump.io/random/quote | data $.value | meme Trump yells at lawnmower kid: %s /
cvic commented 5 years ago

random_chomskybot_quote:

!scrape http://rubberducky.org/cgi-bin/chomsky.pl p
cvic commented 5 years ago

Give me a random API!

!json https://api.publicapis.org/random | json path $.entries[*].Link
cvic commented 5 years ago

Social good ipsum (in English)

!curl http://www.makesum.com/libraries/generate_ipsum/115/1/0
cvic commented 5 years ago

Get the Slack API changelog:

!scrape https://api.slack.com/changelog .page_changelog ul>li text
cvic commented 5 years ago

Give me a random genre:

!json https://binaryjazz.us/wp-json/genrenator/v1/genre/
cvic commented 5 years ago

Just give me a random cat picture!

!json https://aws.random.cat/meow | data  $.file
cvic commented 5 years ago

Give me some random /mu/ garbage

!json https://a.4cdn.org/mu/1.json | json path $.threads.[*].posts.[*].com | tail -n1
cvic commented 5 years ago

Music... stuff

!json http://openwhyd.org/u/52ed71ab7e91c862b2b4e1a5/playlist/10?format=json | data $.[*].name

More details here https://openwhyd.github.io/openwhyd/API

cvic commented 5 years ago

Software license foo

!json https://licenseapi.herokuapp.com/licenses/agpl-3.0 | json path $.description

Or just

!json https://licenseapi.herokuapp.com/licenses/agpl-3.0 | data $.description
cvic commented 5 years ago

I'm hungry...

!json https://baconipsum.com/api/?type=meat-and-filler
cvic commented 5 years ago

Give me a random insult!

!json https://evilinsult.com/generate_insult.php?lang=en&type=json | data $.insult
cvic commented 5 years ago

And another fun idea: give me a random scraper example.

devth commented 5 years ago
!alias swanson = "json https://ron-swanson-quotes.herokuapp.com/v2/quotes | json path $.[0]"
!swansom | meme swanson
devth commented 5 years ago

Show data behind yetibot's history e.g.

!history | random | data show
!history | random | render {{user-name}} said {{body}} at {{created-at}}
cvic commented 5 years ago

Not too sure about the elegance of words | head | tail | unwords...

!json https://api.spacexdata.com/v3/launches/latest | data $.details | words | head 40 | tail 20 | unwords | meme Elon Musk smoking a joint: %s
cvic commented 5 years ago

Give a random beer description

!json https://api.punkapi.com/v2/beers/random | data $.[0].description
cvic commented 5 years ago

👌

!curl https://raw.githubusercontent.com/codefornl/engineering-values/master/README.md | grep ^\d | random
cvic commented 5 years ago

Give me a screenshot

!alias screenshot = "json https://api.microlink.io?url=$s&screenshot | data $.data.screenshot.url"
!screenshot https://yetibot.com

Check the rate limit

!curl -I https://api.microlink.io/?url=http://yetibot.com | grep remaining
cvic commented 5 years ago

Give me a random top HN article

!echo $(json https://hacker-news.firebaseio.com/v0/topstories.json | random) | json https://hacker-news.firebaseio.com/v0/item/%s.json | render {{title}} {{url}} :popcorn: https://news.ycombinator.com/item?id={{id}} :popcorn:
cvic commented 5 years ago

Chomskybot update

!scrape http://rubberducky.org/cgi-bin/chomsky.pl p text | head | words | head 15 | unwords | meme Noam Chomsky:
cvic commented 5 years ago

Give me a random activity

!json https://www.boredapi.com/api/activity
cvic commented 5 years ago

Give me random demographic data http://api.population.io

!curl http://api.population.io:80/1.0/population/2019/China/18/ | js %s[0]
devth commented 5 years ago
!json https://api.exchangeratesapi.io/latest | render {% for currency,rate in rates %} *{{currency|str}}* is {{rate}}, {% endfor %} as of {{date}} *for base currency {{base}}*
cvic commented 5 years ago

Give me a random quote + the author's name

!json https://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en | render {{quoteText}} *{{quoteAuthor}}*
cvic commented 5 years ago

Give me domain info

!json https://api.domainsdb.info/search?query=amazon.com
cvic commented 5 years ago

Give me Teleport data

!json https://api.teleport.org/api/countries/iso_alpha2:DK/salaries
!json https://api.teleport.org/api/countries/iso_alpha2:US/admin1_divisions/geonames:CA
!json http://api.teleport.org/api/cities/geonameid:1796236
!json http://api.teleport.org/api/cities/geonameid:1796236 | render {{name}} {{location}}
!json https://api.teleport.org/api/cities/geonameid:5391959/

https://developers.teleport.org/api/resources/Root/

cvic commented 5 years ago

Give me a random Yes/No gif

!json https://yesno.wtf/api | data $.image
cvic commented 5 years ago

Give me trivia about random numbers/years

!json http://numbersapi.com/random?json | render {{type}}:  {{text}}
!json http://numbersapi.com/random/year?json | data $.text
!json http://numbersapi.com/random/date?json | data $.text
!json http://numbersapi.com/random/trivia?json | data $.text
!json http://numbersapi.com/random/math?json | data $.text

Create some memes

!json http://numbersapi.com/random/trivia?json | data $.text | meme Sunday Trivia Ad: %s
cvic commented 5 years ago

Math and stuff

!json https://newton.now.sh/integrate/x^2+2x
!json https://newton.now.sh/derive/x%5E2

Endpoints here https://github.com/aunyks/newton-api

cvic commented 5 years ago

Give me FB's Terms of Service; Didn't Read

!json https://tosdr.org/api/1/service/facebook.json | data $.pointsData
cvic commented 5 years ago

Give me REST country/capital data

!json https://restcountries.eu/rest/v2/alpha/is
!curl https://restcountries.eu/rest/v2/capital/tallinn | js %s[0]
cvic commented 5 years ago

Give me words related to duck that start with the letter b

!curl https://api.datamuse.com/words?ml=duck&sp=b*&max=10

etc.

!json https://api.datamuse.com/words?rel_jjb=computer | render {{word}}

Full reference here https://www.datamuse.com/api/

cvic commented 5 years ago

Give me some random earthquakes

!json http://api.geonames.org/earthquakesJSON?formatted=true&north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo&style=full

More here http://www.geonames.org/export/ws-overview.html