<commit_before><?php
/**
 * @package Plurk
 * @version 0.9
 */
/*
Plugin Name: Plurk
Plugin URI: https://github.com/jnlin/wp_plurk
Description: Notify your friends when you make a new post
Author: <NAME>
Version: 0.9
Author URI: http://github.com/jnlin/wp_plurk
*/

require __DIR__ . '/plurkAPI.php';

function do_post_plurk($post_id)
{
    if (!('publish' == $_POST['post_status'] and 'publish' != $_POST['original_post_status'])) {
//	return;
    }

    $post = get_post($post_id);
    $url = get_permalink($post_id);

    $plurk = new PlurkAPI(get_option('plurk_consumer_key'),
	    get_option('plurk_consumer_secret'),
	    get_option('plurk_token_key'),
	    get_option('plurk_token_secret'));

    $ret = $plurk->callAPI('/APP/Timeline/plurkAdd', array(
		'content' => "$url ({$post->post_title})",
		'qualifier' => ':',
		'limited_to' => '[3143486]',
		));

    add_post_meta($post_id, 'plurk-post-id', $ret->plurk_id, true);
}

add_action('publish_post', 'do_post_plurk');
add_action('admin_menu', 'plurk_option_page');
add_action('admin_init', 'plurk_register_settings' );
add_filter('the_content','plurk_show_posts');

function plurk_show_posts($content = '')
{
    global $post;
    if (!is_single()) {
	return $content;
    }<commit_msg>remove test code<commit_after><?php
/**
 * @package Plurk
 * @version 0.9
 */
/*
Plugin Name: Plurk
Plugin URI: https://github.com/jnlin/wp_plurk
Description: Notify your friends when you make a new post
Author: <NAME>
Version: 0.9
Author URI: http://github.com/jnlin/wp_plurk
*/

require __DIR__ . '/plurkAPI.php';

function do_post_plurk($post_id)
{
    if (!('publish' == $_POST['post_status'] and 'publish' != $_POST['original_post_status'])) {
	return;
    }

    $post = get_post($post_id);
    $url = get_permalink($post_id);

    $plurk = new PlurkAPI(get_option('plurk_consumer_key'),
	    get_option('plurk_consumer_secret'),
	    get_option('plurk_token_key'),
	    get_option('plurk_token_secret'));

    $ret = $plurk->callAPI('/APP/Timeline/plurkAdd', array(
		'content' => "$url ({$post->post_title})",
		'qualifier' => ':',
		));

    add_post_meta($post_id, 'plurk-post-id', $ret->plurk_id, true);
}

add_action('publish_post', 'do_post_plurk');
add_action('admin_menu', 'plurk_option_page');
add_action('admin_init', 'plurk_register_settings' );
add_filter('the_content','plurk_show_posts');

function plurk_show_posts($content = '')
{
    global $post;
    if (!is_single()) {
	return $content;
    }
{'fraction_non_alphanumeric': 0.17949756888168558, 'fraction_numerical': 0.006077795786061589, 'mean_word_length': 4.935096153846154, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1582422', 'n_tokens_mistral': 985, 'n_tokens_neox': 944, 'n_words': 156}