<?php chdir('..'); require_once 'data/configs/application.inc'; require_once LIB_PATH . 'YMAPI/jymengine.class.php'; $engine = new JYMEngine(YM_CONSUMER_KEY, YM_CONSUMER_SECRET, YM_USER, YM_USER_PASS); $engine->fetch_request_token(); $engine->fetch_access_token(); echo $result . "\n"; echo date('Y-m-d H:i:s') . "\n";
<?php require_once '../data/configs/application.inc'; require_once LIB_PATH . 'YMAPI/jymengine.class.php'; $engine = new JYMEngine(YM_CONSUMER_KEY, YM_CONSUMER_SECRET, YM_USER, YM_USER_PASS); echo YM_CONSUMER_KEY . '<br>'; echo YM_CONSUMER_SECRET . '<br>'; echo YM_USER . '<br>'; echo YM_USER_PASS . '<br>'; $engine->fetch_request_token(); $engine->fetch_access_token(); $signon = $engine->signon(); if (!$signon) { $engine->fetch_request_token(); $engine->fetch_access_token(); $signon = $engine->signon(); } if ($signon) { $engine->save_current_session(); }
* following disclaimer in the documentation and/or other * materials provided with the distribution. * ** Neither the name of Yahoo! Inc. nor the names of its * contributors may be used to endorse or promote products * derived from this software without specific prior * written permission of Yahoo! Inc. * *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ define('USERNAME', 'quangbt2005'); define('PASSWORD', 'tro5ngta6m'); define('CONSUMER_KEY', 'dj0yJmk9RWZ1TkJMTzh0NURhJmQ9WVdrOU1HaDNOMlZJTnpJbWNHbzlNVFk1TkRNeU1UVTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD01OA--'); define('SECRET_KEY', 'fa34a12a894c1c6d102162f3ac22409533401f73'); include_once 'jymengine.class.php'; $engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD); $engine->debug = true; if ($engine->debug) { echo '> Fetching request token' . PHP_EOL; } if (!$engine->fetch_request_token()) { die('Fetching request token failed'); } if ($engine->debug) { echo '> Fetching access token' . PHP_EOL; } if (!$engine->fetch_access_token()) { die('Fetching access token failed'); } $engine->signoff();
<?php chdir('..'); require_once 'data/configs/application.inc'; require_once LIB_PATH . 'YMAPI/jymengine.class.php'; $engine = new JYMEngine(YM_CONSUMER_KEY, YM_CONSUMER_SECRET, YM_USER, YM_USER_PASS); $engine->load_current_session(); $engine->refresh_access_token(); $result = $engine->save_current_session(); echo $result . "\n"; echo date('Y-m-d H:i:s') . "\n";
* materials provided with the distribution. * ** Neither the name of Yahoo! Inc. nor the names of its * contributors may be used to endorse or promote products * derived from this software without specific prior * written permission of Yahoo! Inc. * *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ define('USERNAME', ''); define('PASSWORD', ''); define('CONSUMER_KEY', ''); define('SECRET_KEY', ''); include_once 'jymengine.class.php'; $engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD); $engine->debug = false; if ($engine->debug) { echo '> Fetching request token' . PHP_EOL; } if (!$engine->fetch_request_token()) { die('Fetching request token failed'); } if ($engine->debug) { echo '> Fetching access token' . PHP_EOL; } if (!$engine->fetch_access_token()) { die('Fetching access token failed'); } if ($engine->debug) { echo '> Signon as: ' . USERNAME . PHP_EOL;
<?php chdir('..'); require_once 'data/configs/application.inc'; require_once LIB_PATH . 'YMAPI/jymengine.class.php'; $engine = new JYMEngine(YM_CONSUMER_KEY, YM_CONSUMER_SECRET, YM_USER, YM_USER_PASS); $engine->load_current_session(); $result = $engine->keep_alive_session(); echo $result . "\n"; echo date('Y-m-d H:i:s') . "\n";