<commit_before>package Spoor::Forwarder::Delicious;

use strict;
use base 'Spoor::Forwarder';

use Net::Delicious;
use LWP::UserAgent;
use HTML::TreeBuilder;
use Regexp::Common qw(microsyntax);
use YAML;

use Spoor::Config;

# Process entry, returning true on success (forwarded or skipped)
sub process_entry {
  my ($self, $entry) = @_;

  my $post = $self->process_post($entry->title, $entry->content);
  printf "[%s] %s, %s, %s\n", $entry->published, $post->{url}, $post->{tags}, $post->{desc} 
    if $self->{verbose};

  # Skip posts without urls
  unless ($post->{url}) {
    print "No url found in post '" . $entry->title . "' - skipping \n" 
      if $self->{verbose};
    return 1;
  }

  unless ($self->{noop}) {
    $self->{delicious} ||= Net::Delicious->new({
      user      => $self->{config}->{username},
      pswd      => $self->{config}->{password},
      endpoint  => $self->{config}->{endpoint},
    }) or die "Connect to delicious failed\n";
    
    $self->{delicious}->add_post({
      url             => $post->{url},
      description     => $post->{desc},
      tags            => $post->{tags},
      dt              => $entry->published,<commit_msg>Tweak endpoint handling in Forwarder::Delicious.<commit_after>package Spoor::Forwarder::Delicious;

use strict;
use base 'Spoor::Forwarder';

use Net::Delicious;
use LWP::UserAgent;
use HTML::TreeBuilder;
use Regexp::Common qw(microsyntax);
use YAML;

use Spoor::Config;

# Process entry, returning true on success (forwarded or skipped)
sub process_entry {
  my ($self, $entry) = @_;

  my $post = $self->process_post($entry->title, $entry->content);
  printf "[%s] %s, %s, %s\n", $entry->published, $post->{url}, $post->{tags}, $post->{desc} 
    if $self->{verbose};

  # Skip posts without urls
  unless ($post->{url}) {
    print "No url found in post '" . $entry->title . "' - skipping \n" 
      if $self->{verbose};
    return 1;
  }

  unless ($self->{noop}) {
    $self->{delicious} ||= Net::Delicious->new({
      user      => $self->{config}->{username},
      pswd      => $self->{config}->{password},
      $self->{config}->{endpoint} ? ( endpoint  => $self->{config}->{endpoint} ) : (),
    }) or die "Connect to delicious failed\n";
    
    $self->{delicious}->add_post({
      url             => $post->{url},
      description     => $post->{desc},
      tags            => $post->{tags},
      dt              => $entry->published,
{'fraction_non_alphanumeric': 0.1985172981878089, 'fraction_numerical': 0.0008237232289950577, 'mean_word_length': 2.981967213114754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 71, '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': '2468691', 'n_tokens_mistral': 837, 'n_tokens_neox': 806, 'n_words': 190}