File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55require dirname (__DIR__ ) . '/vendor/autoload.php ' ;
66
77// your own username and password are required to use the Discogs API
8- $ label_id = null ;
8+ $ username = null ;
99$ password = null ;
10- $ discogs = new Discogs ($ label_id , $ password );
11- $ label_id = ' 1212668 ' ;
10+ $ discogs = new Discogs ($ username , $ password );
11+ $ label_id = 1212668 ;
1212
1313try {
1414 $ results = $ discogs ->get_label ($ label_id );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use AmpacheDiscogs \Discogs ;
4+
5+ require dirname (__DIR__ ) . '/vendor/autoload.php ' ;
6+
7+ // your own username and password are required to use the Discogs API
8+ $ username = null ;
9+ $ password = null ;
10+ $ discogs = new Discogs ($ username , $ password );
11+
12+ $ artist = 'Code 64 ' ;
13+ $ album = 'The Shape ' ;
14+ $ artistId = 129150 ;
15+ $ masterId = 2871442 ;
16+ $ releaseId = 25201483 ;
17+
18+ try {
19+ $ results = $ discogs ->search_release ($ artist , $ album );
20+
21+ print_r ($ results );
22+
23+ $ results = $ discogs ->search_master ($ artist , $ album );
24+
25+ print_r ($ results );
26+
27+ $ results = $ discogs ->get_artist_releases ($ artistId );
28+
29+ print_r ($ results );
30+
31+ $ results = $ discogs ->get_release ($ releaseId );
32+
33+ print_r ($ results );
34+
35+ $ results = $ discogs ->get_master ($ masterId );
36+
37+ print_r ($ results );
38+
39+ $ results = $ discogs ->get_master_versions ($ masterId );
40+
41+ print_r ($ results );
42+ } catch (Exception $ exception ) {
43+ print_r ($ exception ->getMessage ());
44+ }
Original file line number Diff line number Diff line change 99$ password = null ;
1010$ discogs = new Discogs ($ username , $ password );
1111$ username = 'discogsUsername ' ;
12+ $ list_id = 1596537 ;
1213
1314try {
1415 $ results = $ discogs ->get_profile ($ username );
2223 $ results = $ discogs ->get_wantlist ($ username );
2324
2425 print_r ($ results );
26+
27+ $ results = $ discogs ->get_list ($ list_id );
28+
29+ print_r ($ results );
2530} catch (Exception $ exception ) {
2631 print_r ($ exception ->getMessage ());
2732}
You can’t perform that action at this time.
0 commit comments