(Issue #752) Add user-side /data/interests (JSON), remove site-side /misc/interestdata

Add a JSON API endpoint for retrieving user interests, and remove the old script.

No replacement is being made for the previous ?int= functionality to find the count for a single interest; this was apparently rarely used.

The new file is based on the Edges.pm file, so I've left the credits for that file as I'm not sure how much of the stuff I deleted is theirs. (Commit b879927 shows the exact amount that was deleted.)

Fixes #752.
Yeah I took a quick look and couldn't find anything that
handled it automatically. I think I misremembered and what we
have automatically are the content type.





On Wed, Jun 25, 2014, at 02:56 AM, Sophira wrote:

  In cgi-bin/DW/Controller/Interests.pm:
> +# the same terms as Perl itself. For a copy of the license, please re
ference
> +# 'perldoc perlartistic' or 'perldoc perlgpl'.
> +#
> +
> +package DW::Controller::Interests;
> +
> +use strict;
> +use warnings;
> +use DW::Routing;
> +use DW::Request;
> +use LJ::JSON;
> +
> +DW::Routing->register_string(  "/data/interests", \&interests_handler
, user => 1, format => 'json' );
> +
> +my $formats = {
> +    'json' => sub { $_[0]->print( to_json( $_[1] ) ); },

  I didn't look into if it was handled automatically or not,
  and don't have much idea how I would go about finding out;
  again, this is basically copied directly from Edges.pm. :)

  —

Reply to this email directly or [1]view it on GitHub.

References

1. https://github.com/dreamwidth/dw-free/pull/757/files#r14177054