问题
I'm trying to learn reddit code and using this https://github.com/jcleblanc/reddit-php-sdk
There's a method in this library $reddit->getUser()
which outputs null
always. Everything else seems to be working though.
include_once("jcleblanc-reddit-php-sdk-4a4cc32/reddit.php");
$reddit = new reddit("my-username", "my-password");
$userData = $reddit->getUser();
var_dump($userData);
outputs null
.
$response = $reddit->getListing("all", 5);
var_dump($response);
outputs what's expected just fine. Then what could be going wrong with $reddit->getUser()
?
回答1:
this is Jonathan LeBlanc, I created that library. I'm running tests right now and I don't seem to be seeing the same issues. This is the code I'm running with the library:
<?php
require_once("reddit.php");
$reddit = new reddit("USERNAME", "PASSWORD");
var_dump($reddit->getUser());
?>
When running that, I am seeing my user data object coming through. Are you still experiencing this issue?
- Jon
来源:https://stackoverflow.com/questions/12810166/a-reddit-php-sdk-method-not-outputting-anything