Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get last meetup event command #46

Merged
merged 11 commits into from
Oct 20, 2020
Merged

Get last meetup event command #46

merged 11 commits into from
Oct 20, 2020

Conversation

javleds
Copy link
Contributor

@javleds javleds commented Jul 17, 2020

GetLatestMeetupEventCommand

This command uses a web crawler to fetch the latest meetup event,
it could be used while we finish the Meetup Client Wrapper.

The command flow is:

  1. The command attempts to get the MEETUP_EVENTS_URL.
  2. The command crawls the response to hydrate the MeetupEvent entity.
  3. The command returns the MeetupEvent.
  4. The command search into the database if the MeetupEvent already exists.
  5. If the MeetupEvent already exists it updates te information.
  6. If not, it will create a record.

Usage

./bin/console phpmx:meetup:last-event

Output

There are 4 possible outputs:

  • Error: If the process fails trying to retrieve the event.
  • Warning: If the meetup page does not have any event.
  • Success: If the event is found and it is not in our database, also display information of the saved record.
  • Update success: If the event is found and already exists in our database, also display information of the saved record.

Additional Deployment steps:

  1. Install the crawler package dependency:
composer install
  1. Add the MEETUP_EVENTS_URL environment variable into the .env file:
MEETUP_EVENTS_URL=https://meetup.com/PHP-The-Right-Way/events/
  1. Run migrations to add the table to cache the MeetupEvent
./bin/console doctrine:migra:migra
# or
./bin/console doctrine:migrations:execute --up 20200717075051
./bin/console doctrine:migrations:execute --up 20200728024807
./bin/console doctrine:migrations:execute --up 20200728231947

Copy link

@marianorenteria marianorenteria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a minor comment.
How will the event crawler be executed? Is there a command to be ran and that maybe shall be set in a cronjob?

<div>
<div>
<p class="text--small padding--top margin--halfBottom">&nbsp;<br />&nbsp;<br />&nbsp;</p>
<p class="text--small padding--top margin--halfBottom">La decripción del meetup</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decripción > descripción

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a minor comment.
How will the event crawler be executed? Is there a command to be ran and that maybe shall be set in a cronjob?

The execution plan is not planned yet jeje, it could be performed as a cronjob each day in order to get the latest count of attendees.

Copy link
Member

@gueroverde gueroverde Jul 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i remember asking @dmouse if it is possible to create cronjob on the server i remember he said yes, could you confirm @dmouse ?

src/Entity/MeetupEvent.php Show resolved Hide resolved
src/Service/CrawlNode.php Outdated Show resolved Hide resolved
@javleds
Copy link
Contributor Author

javleds commented Oct 17, 2020

Este PR soluciona los issues #40 y #38

@dmouse
Copy link
Member

dmouse commented Oct 20, 2020

Gran trabajo @javleds

@gueroverde gueroverde requested a review from jashk October 20, 2020 01:33
@jashk
Copy link
Contributor

jashk commented Oct 20, 2020

Buen trabajo @javleds, vamos a hacer el merge, probamos el comando y abrimos un nuevo cuando se implemente en el nuevo diseño.

@jashk jashk merged commit 2908614 into phpmx:master Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants