Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * zakładamy, że skrypt jest w głównym katalogu, a biblioteka Wapi w libs/Wapi.php
- */
- include('libs/Wapi.php');
- $wapi = new libs_Wapi('TWOJKLUCZ', 'TWOJSEKRET');
- echo '<h1>Strona główna</h1>';
- $result = $wapi->doRequest('links/promoted');
- if ($wapi->isValid())
- {
- echo '<ul>';
- foreach ($result as $r)
- {
- echo '<li>' . $r['title'] . '</li>';
- }
- echo '</ul>';
- } else {
- echo $wapi->getError();
- }
- echo '<h1>Dowcipy z mikrobloga</h1>';
- $result = $wapi->doRequest('search/entries', array('q' => '#suchar'));
- if ($wapi->isValid())
- {
- echo '<ul>';
- foreach ($result as $r)
- {
- echo '<li>' . $r['body'] . '</li>';
- }
- echo '</ul>';
- } else {
- echo $wapi->getError();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement