php-snapchat
php-snapchat copied to clipboard
Fatal error when getting snaps
Hi,
When i run the following code on my machine, I get an fatal error. It worked fine until two days ago.
$snapchat = new Snapchat( SNAP_USER, SNAP_PASS ); $snaps = $snapchat->getSnaps();
Fatal error: Call to a member function get() on a non-object in /www-root/lib/snapchat.php on line 234
Any help would be appreciated!
Have you tried using a clean version of this library? Otherwise you might have the same issue as here https://github.com/JorgenPhi/php-snapchat/issues/3
I've downloaded the newest version, but I still get the same error.
I guess the snapchat server could have blacklisted my IP address, but it's hard to tell from this error message.
Any ideas?
It's indeed hard to tell from the error message you get. You can check if you still have this problem when you test your code through a vpn. If you're hosting this library on localhost you can install SurfEasy VPN ( https://www.surfeasy.com/ ), you'll get a free amount of bandwith. Note: you have to use a VPN on the server side, your server needs a new IP, not on the client side.
Do you still have the problem then?
Sorry, I pasted a wrong url, you need this one: https://www.surfeasy.com/ . (I also edited the previous comment.)
The error message was caused by wrong file permissions on some of the snapchat library files.
I'm sorry for your inconvenience.
What was the required file permissions? This just started happening to us as well
This permissions work for me. The "myuser" and "mygroup" is the user and group that runs the snapchat download script.
drwxr-xr-x 2 myuser mygroup 4096 2014-02-28 02:16 . drwxrwx--- 7 myuser mygroup 4096 2014-02-28 22:52 .. -rw-r--r-- 1 myuser mygroup 229043 2014-01-28 00:33 ca_bundle.crt -rw-r--r-- 1 myuser mygroup 7042 2014-02-28 02:16 snapchat_agent.php -rw-r--r-- 1 myuser mygroup 1169 2014-01-28 00:33 snapchat_cache.php -rwxr-xr-x 1 myuser mygroup 26322 2014-01-28 00:33 snapchat.php
Thanks, i've got those exact same permissions and i'm still getting errors, must be a different issue!
The problem reappeared for me also. This time there is no problem with the permission.
nowned: Did you figure out anything more?
What error message do you get @mattiz ?
dprogramming:
Fatal error: Call to a member function get() on a non-object in /var/www/hosted/snaps.kopweb.net/www-root/lib/snapchat.php on line 234
Possibly your server IP got blocked? Try your code on localhost...
As far as I can tell, the IP is not blocked, but the account seem to be disabled.
Feature request: Better error messages on failed login
So it works now with a different account?
hi i have the same error Fatal error: Call to a member function get() on a non-object in /public_html/snapchat/src/snapchat.php on line 234 but only when i whant to add or delete friend, if i whant to list my friend or display my snaps its working
do you have idea??
$snapchat = new Snapchat($username,$password); $message = $snapchat->deleteFriend($suppr); print_r ($message);
Same issue here!