I need help guys, are you familiar with the alchemy api? its a seo tool that runs on different platforms and what it does it extracts contents from web pages it uses the principle of content scraping. I downloaded the php SDK for alchemy api and i got an error i cannot load the page and if anyone here in this forum that is familiar with alchemy api or good with php i really need your help guys. the error says Fatal error: Class 'AlchemyAPI' not found in line 44

function CheckNoParams() {

$alchemyObj = new AlchemyAPI();//line 44
$alchemyObj->loadAPIKey("api_key.txt");


$htmlFile = file_get_contents("../example/data/example.html");
$htmlFile2 = file_get_contents("../example/data/example2.html");

I've never heard of Alchemy at all but it's possible that your hosting company doesn't support file_get_contents(). Try using cURL instead.

Better yet, can you tell us what the error message is??

Oh, and incidentally, here's how you would use cURL instead of file_get_contents():

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'http://www.website.com/example.html');
$htmlFile = curl_exec($ch);
curl_close($ch);

Like I said, there's not much help that I can offer without knowing what the error message is. It's possible that you are specifying the wrong path for the api_key text file or the wrong path for the example data. It's possible that your server doesn't support file_get_contents(). It's possible that you're not including the AlchemyAPI class within the php file that is declaring the alchemy object. Lots of things could be the issue here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.