Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get this to work. #56

Open
shiznewski opened this issue Dec 4, 2014 · 23 comments
Open

Can't get this to work. #56

shiznewski opened this issue Dec 4, 2014 · 23 comments

Comments

@shiznewski
Copy link

i'm trying to login, add friend and send snap image (jpg).

I will pay someone $25 to help me do this. I have spend many hours and i can't get it to work

@hako
Copy link
Collaborator

hako commented Dec 4, 2014

Here's an example:

$s = new Snapchat("YOUR_USERNAME", "YOUR_PASSWORD");

$snaps = $s->addFriend('FRIEND');

$snap = $s->upload(
    Snapchat::MEDIA_IMAGE,
    file_get_contents('IMAGE.jpg')
);

$s->send($snap, array('FRIEND'), 5);

Did you look at the usage section?
https://github.com/JorgenPhi/php-snapchat#usage

If so, I need more detail of the problem please.

@shiznewski
Copy link
Author

Yes i looked at the usage section. I copied all the files i snapchat.php, snapchat_agent.php, snapchat_cache.php
ca_bundle.crt

i made a new file with your code above. and it doesn't login.
require_once('src/snapchat.php');
$s = new Snapchat("shiznewskii", "mypass");

//$snaps = $s->addFriend('FRIEND');

$snap = $s->upload(
Snapchat::MEDIA_IMAGE,
file_get_contents('clown.jpg')
);

$s->send($snap, array('friendsname'), 5);

I'm not sure if i have the wrong login server or what

@hako
Copy link
Collaborator

hako commented Dec 4, 2014

What errors do you get when you run the code?

@shiznewski
Copy link
Author

none. if i put an echo in the login function to output if it makes it to the failed if, i always see it. so i'm not sure what the problem is.

is the page im using to test the code i posted above. I can zip up the folder if you would like

@hako
Copy link
Collaborator

hako commented Dec 4, 2014

Compress it and i'll see what the problem is.

@hako
Copy link
Collaborator

hako commented Dec 4, 2014

You missed out <?php at the start of the file.

@shiznewski
Copy link
Author

i just doubled checked every file to make sure they have in them. It still doesn't work.
i added a line "echo 'i didnt log in';" in the login failed part of the function. it always fails on the login.

@hako
Copy link
Collaborator

hako commented Dec 4, 2014

It seems it's working for me on my end, It might be your server.

Could you run var_dump() on the $s variable?
eg. var_dump($s);

@shiznewski
Copy link
Author

Here is the output. Its the same on my cheap hostgator hosting, and on my vps at digitalocean.
object(Snapchat)#1 (2) { ["auth_token"]=> bool(false) ["username"]=> bool(false) }

@hako
Copy link
Collaborator

hako commented Dec 5, 2014

I cannot log in. my client is telling me it's incorrect. Is it SFTP or FTP?

Also, I tested the code on Heroku and it works fine except with your login.
Try make a new user on Snapchat.

@shiznewski
Copy link
Author

Sorry i'm an idiot. the username is admin_helper3

I just tried it with my real snapchat user and pass still doesn't work. Its been driving me nuts all day. I tried user:pass and email:pass. doesn't seem to want to work. It seemed like it worked for you with my credentials ones because i got an email about it.
It looks like someone logged into your account from a device named "Android" on 12/04/2014 at 23:10:31 UTC. The login took place somewhere near Lincoln, ENG, GB (IP = 212.219.220.117).

@hako
Copy link
Collaborator

hako commented Dec 5, 2014

That was me testing it. Did Snapchat send that to you?

@shiznewski
Copy link
Author

yea snapchat sent that to me. So it looks like it logged in for you once atleast. it didn' t do that for me ever today.

@shiznewski
Copy link
Author

i just received a snap from the account in the source with the clown picture.

@hako
Copy link
Collaborator

hako commented Dec 5, 2014

Yeah, It also looks like that Snapchat is trying to block your server.
I used Runscope to get around it, but it's still trying to block your requests.

That's why you cannot log in.

{
  "message": "The network you are connected to has been temporarily blocked because of suspicious  activity",
  "status": 403,
  "logged": false
}

For a workaround see #42
and
https://github.com/HSPSoftware/php-snapchat

@shiznewski
Copy link
Author

Thank you for the help.i moved it to a new ip and it works. Plus the new thread you linked me to helps with savin the auth.

@fefogarcia
Copy link

I'm having a similar issue on my Digital Ocean server. If I create the object with an existing access token, all the subsequent requests work perfectly, but if I try to log in with a username and password I get this.

object(Snapchat)[169]
  public 'auth_token' => boolean false
  public 'username' => boolean false

In my local machine everything works. At first I thought my server might be getting rejected for some reason (even though it's been this way from the start so it can't be the number of requests), but after trying with a new IP (and failing) and finding out the requests work with an existing token, I'm left wondering if there's some server-related issue on the login method.

@jvkassi
Copy link

jvkassi commented Dec 25, 2014

Help !
I can't login too.

object(Snapchat)#1 (2) {
  ["auth_token"]=>
  bool(false)
  ["username"]=>
  bool(false)
}

@fefogarcia
Copy link

I used to not be able to log in only from my server and found out it was blocked.

Since yesterday, however, I haven’t been able to log in from any of my scripts - not even from my local computer. I think this API, maybe the endpoints it's using, has been compromised.

Felipe Edoardo
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Thursday, December 25, 2014 at 1:22 PM, mib4fun wrote:

Help !
I can't login too.
object(Snapchat)#1 (2) { ["auth_token"]=> bool(false) ["username"]=> bool(false) }


Reply to this email directly or view it on GitHub (#56 (comment)).

@hako
Copy link
Collaborator

hako commented Dec 26, 2014

@mib4fun @Fegd this is most likely to do with Snapchat's headers. Could you try changing your headers? see #64

@fefogarcia
Copy link

Didn't work for me, unfortunately, and some friends haven't been able to use their iOS third-party Snapchat apps either

@hako
Copy link
Collaborator

hako commented Dec 26, 2014

Can you provide some sample code so I can investigate further?

@fefogarcia
Copy link

I use exactly the code that is here - operations using an existing auth_token work, but I can't login with a username and password, it just returns false.

I'm going to put some var_dumps into the login and post methods to see if I can see the actual response from the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants