<commit_before><?php

namespace Olitaz\HomeBundle\WS;

use Symfony\Component\HttpKernel\Log\LoggerInterface;

class Tumblr {

    /**
     * @var string
     */
    private $entryPoint;
    /**
     * @var string
     */
    private $apiKey;
    /**
     * @var Symfony\Component\HttpKernel\Log\LoggerInterface
     */
    private $logger;

    /**
     * Constructor
     *
     * @param string $apiKey
     * @param LoggerInterface $logger
     */
    public function __construct($entryPoint, $apiKey, LoggerInterface $logger)
    {
        $this->entryPoint = $entryPoint;
        $this->apiKey = $apiKey;
        $this->logger = $logger;
    }

    public function retrieveLastPosts($number)
    {
        $response = $this->call('posts', array('limit' => $number));

        if(!$response || 200 != $response->meta->status || !$response->response->posts)
        {
            return null;
        }

        $posts = array();
        foreach($response->response->posts as $p) {
            $post['url'] = $p->post_url;
            $post['date'] = $p->date;<commit_msg>filter retrieved posts on tumblr for homepage by type: text<commit_after><?php

namespace Olitaz\HomeBundle\WS;

use Symfony\Component\HttpKernel\Log\LoggerInterface;

class Tumblr {

    /**
     * @var string
     */
    private $entryPoint;
    /**
     * @var string
     */
    private $apiKey;
    /**
     * @var Symfony\Component\HttpKernel\Log\LoggerInterface
     */
    private $logger;

    /**
     * Constructor
     *
     * @param string $apiKey
     * @param LoggerInterface $logger
     */
    public function __construct($entryPoint, $apiKey, LoggerInterface $logger)
    {
        $this->entryPoint = $entryPoint;
        $this->apiKey = $apiKey;
        $this->logger = $logger;
    }

    public function retrieveLastPosts($number)
    {
        $response = $this->call('posts/text', array('limit' => $number));

        if(!$response || 200 != $response->meta->status || !$response->response->posts)
        {
            return null;
        }

        $posts = array();
        foreach($response->response->posts as $p) {
            $post['url'] = $p->post_url;
            $post['date'] = $p->date;
{'fraction_non_alphanumeric': 0.15097771714415645, 'fraction_numerical': 0.002728512960436562, 'mean_word_length': 2.1746031746031744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, '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': '7539700', 'n_tokens_mistral': 675, 'n_tokens_neox': 650, 'n_words': 128}