Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some scraper / json / render examples #36

Open
devth opened this issue Feb 26, 2019 · 36 comments
Open

Add some scraper / json / render examples #36

devth opened this issue Feb 26, 2019 · 36 comments

Comments

@devth
Copy link
Member

devth commented Feb 26, 2019

No description provided.

@devth
Copy link
Member Author

devth commented Feb 26, 2019

!alias random_advice="json https://api.adviceslip.com/advice | json path $.slip.advice"

@devth
Copy link
Member Author

devth commented Feb 26, 2019

How do we get the question & the answer?

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

Could render help?

@devth
Copy link
Member Author

devth commented Feb 26, 2019

!json https://api.tronalddump.io/random/quote | data $.value | meme Trump yells at lawnmower kid: %s /

@cvic
Copy link
Member

cvic commented Feb 26, 2019

random_chomskybot_quote:

!scrape http://rubberducky.org/cgi-bin/chomsky.pl p

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Give me a random API!

!json https://api.publicapis.org/random | json path $.entries[*].Link

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Social good ipsum (in English)

!curl http://www.makesum.com/libraries/generate_ipsum/115/1/0

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Get the Slack API changelog:

!scrape https://api.slack.com/changelog .page_changelog ul>li text

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Give me a random genre:

!json https://binaryjazz.us/wp-json/genrenator/v1/genre/

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Just give me a random cat picture!

!json https://aws.random.cat/meow | data  $.file

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Give me some random /mu/ garbage

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

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Music... stuff

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

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

@cvic
Copy link
Member

cvic commented Feb 26, 2019

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
Copy link
Member

cvic commented Feb 26, 2019

I'm hungry...

!json https://baconipsum.com/api/?type=meat-and-filler

@cvic
Copy link
Member

cvic commented Feb 26, 2019

Give me a random insult!

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

@cvic
Copy link
Member

cvic commented Feb 27, 2019

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

@devth
Copy link
Member Author

devth commented Mar 4, 2019

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

@devth
Copy link
Member Author

devth commented Mar 4, 2019

Show data behind yetibot's history e.g.

!history | random | data show
!history | random | render {{user-name}} said {{body}} at {{created-at}}

@cvic
Copy link
Member

cvic commented Mar 12, 2019

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
Copy link
Member

cvic commented Mar 12, 2019

Give a random beer description

!json https://api.punkapi.com/v2/beers/random | data $.[0].description

@cvic
Copy link
Member

cvic commented Mar 14, 2019

👌

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

@cvic
Copy link
Member

cvic commented Mar 14, 2019

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
Copy link
Member

cvic commented Mar 14, 2019

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
Copy link
Member

cvic commented Mar 15, 2019

Chomskybot update

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

@cvic
Copy link
Member

cvic commented Mar 15, 2019

Give me a random activity

!json https://www.boredapi.com/api/activity

@cvic
Copy link
Member

cvic commented Mar 15, 2019

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 devth changed the title Add some scraper examples Add some scraper / json / render examples Mar 15, 2019
@devth
Copy link
Member Author

devth commented Mar 15, 2019

!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
Copy link
Member

cvic commented Mar 19, 2019

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
Copy link
Member

cvic commented Mar 21, 2019

Give me domain info

!json https://api.domainsdb.info/search?query=amazon.com

@cvic
Copy link
Member

cvic commented Mar 21, 2019

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
Copy link
Member

cvic commented Mar 21, 2019

Give me a random Yes/No gif

!json https://yesno.wtf/api | data $.image

@cvic
Copy link
Member

cvic commented Mar 21, 2019

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
Copy link
Member

cvic commented Mar 21, 2019

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
Copy link
Member

cvic commented Apr 3, 2019

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

!json https://tosdr.org/api/1/service/facebook.json | data $.pointsData

@cvic
Copy link
Member

cvic commented Apr 3, 2019

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
Copy link
Member

cvic commented Apr 3, 2019

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
Copy link
Member

cvic commented Apr 3, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants