GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   FunnyAPI is now open source (https://gfy.com/showthread.php?t=1114021)

fris 06-30-2013 08:30 AM

FunnyAPI is now open source
 
download: https://github.com/chrismccoy/funnyapi

Brief description

Quote:

FunnyAPI is a private invite only image API for WordPress.

I decided to develop a backend for various types of images, mostly humor related to be fetched from the WordPress post screen.

I know I could have simply just uploaded images to each WordPress install, but that would give me a migraine, and I thought it would be easier to have one central database that can be parsed via a Plugin.
Some screenshots:

http://funnyapi.com/help/screens/1.jpg
http://funnyapi.com/help/screens/2.jpg
http://funnyapi.com/help/screens/3.jpg
http://funnyapi.com/help/screens/4.jpg
http://funnyapi.com/help/screens/5.jpg
http://funnyapi.com/help/screens/6.jpg
http://funnyapi.com/help/screens/7.jpg
http://funnyapi.com/help/screens/8.jpg
http://funnyapi.com/help/screens/9.jpg
http://funnyapi.com/help/screens/10.jpg

Installation is pretty straight forward.

Quote:

Easy 5 Step install

1. Upload files to your domain root.
2. chmod the pictures and thumbs directory to be writable
3. Create a mysql database to use and import db.sql into the database
4. Edit config.inc.php in the includes/ directory with your domain, and mysql info.
5. Visit yourdomain.com/admin and login with admin/admin
Also you can parse the api outside of WordPress if you need to use it for a 3rd party app.

an example is in the /api directory called apitest.php

Code:

<?php

define("API_URL", "http://www.funnyapi.com/api/search.php?searchby=%s&q=%s&apikey=%s&max_results=%d&thumbsize=%s");
define('API_KEY', '198fe85619b5bb38758b2fcbe1b67cdc1600f63a');

function api_search($q, $by = 'all', $max_results = 16, $thumbsize = '200x200') {
        $api_url = sprintf(API_URL, $by, $q, API_KEY, $max_results, $thumbsize);
       
        $ch = curl_init($api_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
       
        $json = curl_exec($ch);
        curl_close($ch);
       
        if (stristr(strtolower($json), 'access denied') || stristr(strtolower($json), 'error')) {
                return false;
        } else {
                if (($arr = json_decode($json)) !== FALSE) {
                        return $arr;
                } else {
                        return false;
                }
        }
}

//$q = (isset($_GET['q']) ? $_GET['q'] : 'unassoc');
$q = $_GET['q'];

if(!$q) die('Missing Parameters!');

$results = api_search($q);

if (is_array($results)) {
        foreach ($results as $idx => $obj) {
                echo '<div style="float: left; margin-left: 5px;"><a href="' . $obj->full_url . '" target="_BLANK" title="' . $obj->title . '"><img alt="' . $obj->description . '" src="' . $obj->full_url . '" /></a><p><strong>Tags:</strong>&nbsp;' . implode(',', $obj->tags) . '</p>';
        }
} else {
        echo 'API Request Failed';
}
?>

If anyone needs any help installing or getting running, let me know, you can also use this for say amateur pics if you have a lot of amateur blogs and you want a central location.

:pimp:thumbsup

fris 07-01-2013 09:56 AM

bump for anyone that wants to download it, i will even set it up for you no charge


All times are GMT -7. The time now is 05:11 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123