I've been using this in my shell profile for a few years now: curl -H "Accept: text/plain" https://icanhazdadjoke.com/. - Source: Hacker News / 4 months ago
Import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root', }) export class JokesService { url = 'https://icanhazdadjoke.com'; constructor(private http: HttpClient) {} getJoke(): Observable { return this.http.get(this.url, { headers: { Accept:... - Source: dev.to / 11 months ago
Here's my bot in action. It posts a new dad joke once an hour and look, it's already got 10 followers! I should probably repost a few of its jokes so other people get to see it. It uses the Dad Jokes API to generate random jokes to share. - Source: dev.to / 12 months ago
$ cat `which dadjoke` Foo=$(curl -s -H "Accept: text/plain" https://icanhazdadjoke.com/) /usr/games/cowsay $foo. Source: about 1 year ago
Javascript Async function getJokes(count: number) { let requests = [] for (let I = 0; I < count; i++) { requests.push(fetch("https://icanhazdadjoke.com/", { method: 'GET', headers: { 'Accept': 'application/json', } })) } let responses = await Promise.all(requests) return Promise.all(responses.map(responses => responses.json())) } Var results GetJokes(3).then(jokes => { ... Source: over 1 year ago
Let response = await axios.get('https://icanhazdadjoke.com/', { headers: { "User-Agent": "MyJokeBot/1.0", Accept: "text/plain" } }).catch(console.log) // save it to a db Await mysql_connection.promise().query("INSERT INTO my_joke_db (joke_txt) VALUES (?)", [ response.data ]).catch(console.log). Source: almost 2 years ago
Const getData = async () => { const options = { method: 'GET', headers: { "Accept" : "application/json" } }; try { const response = await fetch('https://icanhazdadjoke.com/', options) if(response.ok) { const jsonResponse = await response.json(); const { joke } = jsonResponse return... Source: almost 2 years ago
Import { Context } from "netlify:edge"; Export default async (request: Request, context: Context) => { const joke = await fetch("https://icanhazdadjoke.com/", { "headers": { "Accept": "application/json" } }); const jsonData = await joke.json(); return context.json(jsonData); };. - Source: dev.to / about 2 years ago
Import React, { Component } from "react"; Import Joke from "./Joke"; Import axios from "axios"; Export class Dashboard extends Component { constructor(props) { super(props); this.state = { jokes: [] }; } async componentDidMount() { const config = { headers: { Accept: "application/json" } }; const { data } = await axios.get(`https://icanhazdadjoke.com/`, config); console.log(data); ... Source: about 2 years ago
For a web/front end focus be sure that you can code simple things in front of people. Something like a GET request to icanhazdadjoke.com was literally the interview I gave to new grads looking for a web role at a previous company. Often, you can use any framework/method you want too. Source: about 2 years ago
Do you know an article comparing icanhazdadjoke to other products?
Suggest a link to a post with product alternatives.
This is an informative page about icanhazdadjoke. You can review and discuss the product here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.