Closed martynball closed 8 years ago
hmm, It seems to be working fine for me.
I managed to recreate that error after a typo in the password or if the internet connection is off. I'm not sure if it's todo with a blocked IP or something.
Are you using the getUpdates()
function?
//Check login
$snapchat = new Snapchat('martynball', 'password');
//Get snapchat feed
$snaps = $snapchat->getSnaps();
echo $snaps;
There's the code
I ran var_dump($snapchat)
on your code and the Snapchat object is empty.
class Snapchat#1 (2) { public $auth_token => bool(false) public $username => bool(false) }
Could this be the reason?
I tried it with my credentials and the object wasn't empty.
<?php
require_once("src/snapchat.php");
// Log in:
$snapchat = new Snapchat('jorgenphi', 'password');
// Get your feed:
$snaps = $snapchat->getSnaps();
var_dump($snaps);
?>
This code works perfectly fine for me (of course using the correct password).
Ah, the code you posted above seems to work perfect, thanks!
Sweet! I will tell you that $snaps is an array, not a string, so you can't echo it. You can dump the array's contents using var_dump, and can echo a specific element using this:
echo $snaps['key']
Hi
I get the same now. Worked a few hours ago. var_dump($snapchat) gives me
object(Snapchat)#1 (2) {
["auth_token"]=>
bool(false)
["username"]=>
bool(false)
}
when i use with var_dump its still give me same error
Notice: Undefined property: Snapchat::$cache in D:\Xampp\htdocs\phpsnapchat\src\snapchat.php on line 317
Fatal error: Call to a member function get() on a non-object in D:\Xampp\htdocs\phpsnapchat\src\snapchat.php on line 317
@pank123 this code is outdated. Use this one instead: https://github.com/mgp25/SC-API
Hello thanks for give me this url I have integrate it and first time it was work for me but now its give me Error: UNAUTHORIZED Notice: Trying to get property of non-object in D:\Xampp\htdocs\snapchtapi\src\snapchat.php on line 3079
@pank123 you have to create a casper account, please read the wiki here: https://github.com/mgp25/SC-API
I have create the caster account and set the api key and secret key but still its give me unauthorised error it work for me 2 times but now suddently its stop and give me this error.
I have create the caster account and set the api key and secret key but still its give me unauthorised error it work for me 2 times but now suddently its stop and give me this error. Please help
@pank123 create an issue there: https://github.com/mgp25/SC-API
Not here, and post there the debug log
I have successfully imported the snapchat.php file using require_once, seems to logged in successfully as it's returning an object.
But when I try and fetch my feed i'm getting the following errors: Notice: Undefined property: Snapchat::$cache in C:\xampp\htdocs\snapchat\src\snapchat.php on line 234
Fatal error: Call to a member function get() on a non-object in C:\xampp\htdocs\snapchat\src\snapchat.php on line 234