jonnybarnes.uk/app/Jobs/ProcessLike.php

119 lines
3.2 KiB
PHP
Raw Normal View History

Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
<?php
declare(strict_types=1);
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
namespace App\Jobs;
2017-12-19 16:00:42 +00:00
use App\Models\Like;
use Codebird\Codebird;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Arr;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
use Illuminate\Bus\Queueable;
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
use Thujohn\Twitter\Facades\Twitter;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
Improve tests feature Squashed commit of the following: commit 13ac266b79b496d62291a07f4f5f81940d217ccb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:17:25 2019 +0000 test on 7.2 and 7.3, download phpcs directly from github commit 692cc7dfe165a7ecaf9dba9498c868193b749aee Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:10:16 2019 +0000 Drop code-coverage for now, PHP7.3 and Xdebug aren’t playing ball at the moment commit 03d262c47af79cfa0ce4937cc8e196e3b6f5877a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:09:48 2019 +0000 Use an excewption when generating twitter content of a note commit e2df1e5cebebd30473787c924f495a5687145fb8 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:08:48 2019 +0000 Updating dependencies commit 8008eb53854eddefaa4e302f95353c626b3062ef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Nov 25 16:09:32 2018 +0000 Fix S3 URLs to use config settings commit 941864b9d6c6cb9d87b4b95385ada67f55de837c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Nov 24 21:28:19 2018 +0000 Increase code-coverage in the notes unit tests commit 4a253d3c5c1854dd8ea01d975bb8e709ae697393 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:26:59 2018 +0000 Don’t create new notes in null note test commit 9616cd2b66bc6f26b2d3266f95cf1be894aaed99 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:23:05 2018 +0000 Use Laravel’s FileSystem class to better deal with files/folders in the tearDown methods commit 294f7961ec03d26cc45845632a97b2521a58f403 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:22:28 2018 +0000 Add more unit tests for the geocoding method commit 43328e3ce249fe8df95770f1275cab97f4ca88bc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:18:36 2018 +0000 Improve the revereseGeoCode method commit 84424e1d8274bfe62bc5f0a7556e5732bf094178 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 15:03:14 2018 +0000 Test that empty notes are saved to the DB as null commit 77fd87b81323457ce6f578ed7f359ceb6b3ce6b6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 20:20:03 2018 +0100 Increase test coverage to 100% for the WebMention model commit 4b6da595dc1efc025470279e9012c2a2a90ec3ef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 18:49:33 2018 +0100 Improving test coverage commit 895061b8dd0ddf4fbc321e4f371ea148d9b3007f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 17:19:35 2018 +0100 Improvements in Like tests and code, and WebMentions processing tests and code commit f9a8b96f2c8b1ef22e97d3dc634ee76d97c25cb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Oct 12 22:43:49 2018 +0100 Don’t track the coverage files in git
2019-01-20 17:35:58 +00:00
use GuzzleHttp\Exception\RequestException;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Jonnybarnes\WebmentionsParser\Authorship;
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
class ProcessLike implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
/** @var Like */
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
protected $like;
/**
* Create a new job instance.
*
* @param Like $like
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
*/
public function __construct(Like $like)
{
$this->like = $like;
}
/**
* Execute the job.
*
* @param Client $client
* @param Authorship $authorship
* @return int
* @throws GuzzleException
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
*/
public function handle(Client $client, Authorship $authorship): int
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
{
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
if ($this->isTweet($this->like->url)) {
$codebird = resolve(Codebird::class);
$tweet = $codebird->statuses_oembed(['url' => $this->like->url]);
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
$this->like->author_name = $tweet->author_name;
$this->like->author_url = $tweet->author_url;
$this->like->content = $tweet->html;
$this->like->save();
//POSSE like
try {
$response = $client->request(
'POST',
'https://brid.gy/publish/webmention',
[
'form_params' => [
'source' => $this->like->url,
'target' => 'https://brid.gy/publish/twitter',
],
]
);
Improve tests feature Squashed commit of the following: commit 13ac266b79b496d62291a07f4f5f81940d217ccb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:17:25 2019 +0000 test on 7.2 and 7.3, download phpcs directly from github commit 692cc7dfe165a7ecaf9dba9498c868193b749aee Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:10:16 2019 +0000 Drop code-coverage for now, PHP7.3 and Xdebug aren’t playing ball at the moment commit 03d262c47af79cfa0ce4937cc8e196e3b6f5877a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:09:48 2019 +0000 Use an excewption when generating twitter content of a note commit e2df1e5cebebd30473787c924f495a5687145fb8 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 20 17:08:48 2019 +0000 Updating dependencies commit 8008eb53854eddefaa4e302f95353c626b3062ef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Nov 25 16:09:32 2018 +0000 Fix S3 URLs to use config settings commit 941864b9d6c6cb9d87b4b95385ada67f55de837c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Nov 24 21:28:19 2018 +0000 Increase code-coverage in the notes unit tests commit 4a253d3c5c1854dd8ea01d975bb8e709ae697393 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:26:59 2018 +0000 Don’t create new notes in null note test commit 9616cd2b66bc6f26b2d3266f95cf1be894aaed99 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:23:05 2018 +0000 Use Laravel’s FileSystem class to better deal with files/folders in the tearDown methods commit 294f7961ec03d26cc45845632a97b2521a58f403 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:22:28 2018 +0000 Add more unit tests for the geocoding method commit 43328e3ce249fe8df95770f1275cab97f4ca88bc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 18:18:36 2018 +0000 Improve the revereseGeoCode method commit 84424e1d8274bfe62bc5f0a7556e5732bf094178 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Nov 20 15:03:14 2018 +0000 Test that empty notes are saved to the DB as null commit 77fd87b81323457ce6f578ed7f359ceb6b3ce6b6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 20:20:03 2018 +0100 Increase test coverage to 100% for the WebMention model commit 4b6da595dc1efc025470279e9012c2a2a90ec3ef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 18:49:33 2018 +0100 Improving test coverage commit 895061b8dd0ddf4fbc321e4f371ea148d9b3007f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Oct 13 17:19:35 2018 +0100 Improvements in Like tests and code, and WebMentions processing tests and code commit f9a8b96f2c8b1ef22e97d3dc634ee76d97c25cb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Oct 12 22:43:49 2018 +0100 Don’t track the coverage files in git
2019-01-20 17:35:58 +00:00
} catch (RequestException $exception) {
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
//no biggie
}
return 0;
}
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
$response = $client->request('GET', $this->like->url);
$mf2 = \Mf2\parse((string) $response->getBody(), $this->like->url);
if (Arr::has($mf2, 'items.0.properties.content')) {
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
$this->like->content = $mf2['items'][0]['properties']['content'][0]['html'];
}
try {
$author = $authorship->findAuthor($mf2);
if (is_array($author)) {
$this->like->author_name = Arr::get($author, 'properties.name.0');
$this->like->author_url = Arr::get($author, 'properties.url.0');
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
}
if (is_string($author) && $author !== '') {
$this->like->author_name = $author;
}
} catch (AuthorshipParserException $exception) {
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
return 1;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
}
$this->like->save();
return 0;
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
}
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
/**
* Determine if a given URL is that of a Tweet.
*
* @param string $url
* @return bool
*/
Improve likes Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
2018-01-12 21:19:42 +00:00
private function isTweet(string $url): bool
{
$host = parse_url($url, PHP_URL_HOST);
$parts = array_reverse(explode('.', $host));
return $parts[0] === 'com' && $parts[1] === 'twitter';
}
Squashed commit of the following: commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
2017-09-19 16:07:32 +01:00
}