0

I need help guys, are you familiar with the alchemy api? It's an SEO tool that runs on different platforms and what it does is extract 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

Here is my code:

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");
}
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Oliver Ven Quilnet
  • 461
  • 1
  • 4
  • 4

1 Answers1

0

Looks like you haven't use include. Try this:

function CheckNoParams() {
    include "./module/AlchemyAPI.php";
    $alchemyObj = new AlchemyAPI();    // Now line 45 :-P
    $alchemyObj->loadAPIKey("api_key.txt");
    $htmlFile = file_get_contents("../example/data/example.html");
    $htmlFile2 = file_get_contents("../example/data/example2.html");
}

(Assuming you have preserved the original file structure when you downloaded the Alchemy's PHP SDK)

Sterex
  • 1,026
  • 1
  • 13
  • 29