Skip to content

Instantly share code, notes, and snippets.

@ortutay
ortutay / gist:4ef34b9464b9e46c9e6b5dc95b14a55f
Created October 28, 2024 20:02
FetchFox leadgen example
import { fox } from 'fetchfox';
const f = await fox
.config({
diskCache: '/tmp/fetchfox_cache',
fetcher: ['playwright', { headless: false, wait: 4000 }],
})
.init('https://www.google.com/search?q=alabama+political+ad+agencies')
.crawl({ query: 'find links to earch results linking to ad agency companies. offsite search results only, not the ones on google.com.', limit: 10 })
.extract({
const scoreDataPoint = (dataPoint) => {
const sec = dataPoint.sec;
const cost = dataPoint.cost * 1000; // per 1k
const secBench = { good: 4, ok: 10, bad: 30 };
const costBench = { good: 1, ok: 5, bad: 15 };
let penalty = 1.0;
let secScore = 0.0;
package main
import (
"fmt"
"time"
"github.com/garyburd/redigo/redis"
)
func main() {
package main
import (
"fmt"
"time"
"github.com/garyburd/redigo/redis"
)
var test1Script = redis.NewScript(1, `