Git Product home page Git Product logo

spotifycrawler's Introduction

About spotifyCrawler

it's a PHP library for access to spotify contents with spotify’s internal APIs . by using this library you don't need create spotify developer account and run oAuth2 proccess

How use

you need a HTTPS connection for access to spotify's resources then you must include spotifyCrawler.php into your file and use library methods

require 'spotifyCrawler.php';

check examples.php for testing library

a simple request

require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$track_data = $spotify->track('SPOTIFY_TRACK_ID');

spotify contents methods

require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$track_data = $spotify->track('SPOTIFY_TRACK_ID');
$album_data = $spotify->album('SPOTIFY_ALBUM_ID');
$artist_data = $spotify->artist('SPOTIFY_ARTIST_ID');
$artist_albums_data = $spotify->artistAlbums('SPOTIFY_ARTIST_ID');

search into spotify

search(string $text, int $offset = 0, int $limit = 10) : array
require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$search_data = $spotify->search('Future');
$search_data = $spotify->search('Future',20);
$search_data = $spotify->search('Future',32,4);

create client

client_id and it access_token are automatically generate when using contents methods like track() , album() … whatever you can generate new client_id and it access_token by these methods

require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$spotify->createClient();

$client_id = $spotify->clientId;
$clien_token = $spotify->clientToken;

create access token for client

require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$spotify->getAccessToken();

$client_access_token = $spotify->accessToken;

change user agent

maybe spotify block your user-agent , for resolve this problem you can use setUserAgent() method and introduce new user-agent value

require 'spotifyCrawler.php';
$spotify = new spotifyCrawler();
$spotify->setUserAgent('USER_AGENT_TEXT');

spotifycrawler's People

Contributors

farazfathi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.