php-snapchat icon indicating copy to clipboard operation
php-snapchat copied to clipboard

Fatal error when getting snaps

Open mattiz opened this issue 10 years ago • 16 comments

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!

mattiz avatar Feb 26 '14 12:02 mattiz

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

dprogramming avatar Feb 26 '14 15:02 dprogramming

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?

mattiz avatar Feb 26 '14 15:02 mattiz

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?

dprogramming avatar Feb 26 '14 19:02 dprogramming

Sorry, I pasted a wrong url, you need this one: https://www.surfeasy.com/ . (I also edited the previous comment.)

dprogramming avatar Feb 26 '14 19:02 dprogramming

The error message was caused by wrong file permissions on some of the snapchat library files.

I'm sorry for your inconvenience.

mattiz avatar Feb 28 '14 01:02 mattiz

What was the required file permissions? This just started happening to us as well

MatthewHallCom avatar Mar 01 '14 00:03 MatthewHallCom

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

mattiz avatar Mar 01 '14 00:03 mattiz

Thanks, i've got those exact same permissions and i'm still getting errors, must be a different issue!

MatthewHallCom avatar Mar 01 '14 00:03 MatthewHallCom

The problem reappeared for me also. This time there is no problem with the permission.

nowned: Did you figure out anything more?

mattiz avatar Mar 17 '14 13:03 mattiz

What error message do you get @mattiz ?

dprogramming avatar Mar 17 '14 16:03 dprogramming

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

mattiz avatar Mar 17 '14 19:03 mattiz

Possibly your server IP got blocked? Try your code on localhost...

dprogramming avatar Mar 18 '14 15:03 dprogramming

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

mattiz avatar Mar 19 '14 14:03 mattiz

So it works now with a different account?

dprogramming avatar Mar 19 '14 15:03 dprogramming

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);

trankil12 avatar Apr 25 '14 13:04 trankil12

Same issue here!

martynball avatar Jul 10 '14 19:07 martynball