James Bachini

scraping

  • How To Scrape Twitter/X Without API Access

    How To Scrape Twitter/X Without API Access

    Scraping Twitter/X without direct API access can be accomplished by leveraging third-party services like RapidAPI, which provides a streamlined way to interact with Twitter data. In this tutorial, we’ll walk through the process of using RapidAPI to scrape tweets from a specified user. I’m going to provide code snippets in Python and NodeJS for this…

  • Two php functions for scraping content and extracting links

    ////// Grab webpage ////// function webFetcher($url) { $crawl = curl_init(); curl_setopt ($crawl, CURLOPT_URL, $url); curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1); $resulting = $resulting.curl_exec($crawl); curl_close($crawl); return $result = $resulting; } //////////////////////////////// //// extract links //// function extract_links($text) { preg_match_all(‘/<\s*a[^<>]*?href=[\’”]?([^\s<>\’”]*)[\’”]?[^<>]*>(.*?)<\/a>/si’, $text, $match_array, PREG_SET_ORDER); $return = array() ; foreach ($match_array as $serp) { $full_anchor = $serp[0]; $href = $serp[1]; $anchortext =…