<rss version="2.0"
	xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" 	
>
	<channel>
		<title>[ this might be offensive ] : audio</title>
		<link>https://<?= $_SERVER['HTTP_HOST'] ?>/offensive/</link>
		<description>[ this might be offensive ]</description>
		<lastBuildDate><? echo date("r"); ?></lastBuildDate>

<?	
	$args = $_REQUEST;
	if(!array_key_exists("type", $args)) {
		$args["type"] = "audio";
	}

	$result = core_getuploads($args);

	foreach( $result as $upload ) {
		// mark tmbo and nsfw files, if they aren't already
		$filename = $upload->filename();
		$filename = $upload->is_tmbo() == 1 && strpos(strtolower($filename), "[tmbo]") === false ?
				'[tmbo] '.$filename : $filename;
		$filename = $upload->is_nsfw() == 1 && strpos(strtolower($filename), "[nsfw]") === false ?
				'[nsfw] '.$filename : $filename;

		$server = "https://". $_SERVER['HTTP_HOST'];
		$fileURL = $server . $upload->URL();
		$thumbURL = $server . $upload->thumbURL();
		
		if(!file_exists($upload->file())) continue;
?>
Esempio n. 2
0
	/**
	 * @method getuploads
	 * Get one or more uploads' metadata, including (if possible) links to the uploaded files themselves, and their thumbnails.
	 * @param type string optional {"image", "topic", "avatar", "audio"} Get uploads of this type.
	 * @param userid integer optional Get uploads posted by this user.
	 * @param after date optional Get uploads newer than this.
	 * @param before date optional Get uploads older than this.
	 * @param max integer optional Get uploads before this fileid, inclusive.
	 * @param since integer optional Get uploads since this fileid, inclusive.
	 * @param sort string optional {"date_desc", "date_asc", "votes_asc", "votes_desc", "comments_asc", "comments_desc", "activity_asc", "activity_desc"} Default:"date_desc" Result sorting. Sort by vote does not consider [-].
	 * @param limit limit optional Default and maximum is 200.
	 * @param nsfw integer optional {"0", "1"} Set to 0, suppresses posts that are not safe for work. Set to 1, only returns results that are not safe for work.
	 * @param tmbo integer optional {"0", "1"} Set to 0, suppresses posts that might be offensive. Set to 1, only returns results that might be offensive.
	 * @return Array of Upload objects.
	 * @example type=image&nsfw=0&sort=date_asc&limit=3,10
	 * @see getupload
	 */
	function api_getuploads() {
		send(core_getuploads($_REQUEST));
	}