Package Data | |
---|---|
Maintainer Username: | lexismith |
Maintainer Contact: | alexandrasmith00@gmail.com (lexismith) |
Package Create Date: | 2016-07-02 |
Package Last Update: | 2017-02-13 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-29 03:00:27 |
Package Statistics | |
---|---|
Total Downloads: | 20,076 |
Monthly Downloads: | 239 |
Daily Downloads: | 34 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This is a Laravel service provider for making it easy to include the Alchemy API for PHP in a Laravel application.
The Alchemy Service Provider can be installed via Composer by requiring the
lexismith/laravel-alchemy
package in your project's composer.json
.
{
"require": {
"lexismith/laravel-alchemy": "dev-master"
}
}
Then run a composer update
php composer.phar update
To use the Alchemy Service Provider, you must register the provider when bootstrapping your Laravel application.
Find the providers
key in your config/app.php
and register the service provider.
'providers' => array(
// ...
'LexiSmith\LaravelAlchemy\AlchemyServiceProvider',
)
Find the aliases
key in your config/app.php
and add the Alchemy facade alias.
'aliases' => array(
// ...
'Alchemy' => 'LexiSmith\LaravelAlchemy\AlchemyFacade',
)
By default, the package uses the following environment variables to auto-configure the plugin without modification:
API_KEY
BASE_URL
To customize the configuration file, publish the package configuration using Artisan.
php artisan vendor:publish
Update your settings in the generated app/config/alchemy.php
configuration file or by editing your environment variables accordingly in .env
return [
'url' => env('ALCHEMY_URL', 'http://access.alchemyapi.com/calls'),
'key' => env('ALCHEMY_API_KEY')
];
All functions accept three parameters:
$flavor
that describes the type of content being passed. For each function, the options for $flavor
are given.$data
that is given in the form of the $flavor
.$options
that specify options for each specific function, as described below.Tags the concepts for test, a URL, or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::emotion($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the entities for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::entities($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the keywords for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::keywords($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Tags the concepts for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::keywords($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Calculates the sentiment for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::sentiment($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Analyzes sentiment for targeted phrases via text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::sentiment_targeted($flavor, $data, $target, $options);
Additional input:
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the cleaned text (removes ads, navigation, etc.) for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::text($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the raw text (includes ads, navigation, etc.) for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::text_raw($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the author from URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::author($flavor, $data, $options);
Available flavors:
'html'
'url'
Available options:
Detects the language for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::language($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Extracts the title for a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::title($flavor, $data, $options);
Available flavors:
'html'
'url'
Available options:
Extracts the relations for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::relations($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Detects the RSS/ATOM feeds for a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::feeds($flavor, $data, $options);
Available flavors:
'html'
'url'
Available options:
Extracts the microformats for a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::microformats($flavor, $data, $options);
Available flavors:
'html'
'url'
Available options:
Taxonomy classification operations for text, a URL or HTML. For more information, please refer to the overview or the docs.
$emotions = Alchemy::taxonomy($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options:
Combined call for entity, keyword, title, author, taxonomy. For more information, please refer to the overview or the docs.
$emotions = Alchemy::combined($flavor, $data, $options);
Available flavors:
'text'
'html'
'url'
Available options: