-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Changed url for PereiraJS (Colombia) meetup #398
Conversation
👍 |
The changes look good to me but they will be overwritten when the |
woot! Are we the only ones in the world NOT using meetup? 😱 |
From https://nodejs.org/en/get-involved/events/
If it will be overwritten this is a problem? |
I was thinking about something like this: diff --git a/events/custom.json b/events/custom.json
new file mode 100644
index 0000000..5048232
--- /dev/null
+++ b/events/custom.json
@@ -0,0 +1,19 @@
+[
+ {
+ "id": 18205029,
+ "created": 1393477200000,
+ "link": "http://pereirajs.org/",
+ "description": "Comunidad de aprendizaje del lenguaje Javascript",
+ "organizer": {
+ "member_id": "",
+ "name": "",
+ "photo": {
+ "highres_link": "",
+ "photo_id": "",
+ "photo_link": "",
+ "thumb_link": ""
+ }
+ },
+ "members": 30
+ }
+]
diff --git a/events/pull-meetup.js b/events/pull-meetup.js
index 05749c1..d1a3391 100644
--- a/events/pull-meetup.js
+++ b/events/pull-meetup.js
@@ -1,7 +1,9 @@
var request = require('request').defaults({json: true, headers: {'user-agent': 'pull-meeting-0.1'}}),
url = 'https://api.meetup.com/2/groups',
auth = process.env.MEETUP_TOKEN,
+ merge = require('lodash.merge'),
qs = require('querystring'),
+ custom = require('./custom'),
yml = require('./yaml-sync'),
opts =
{ topic: 'nodejs', category: 34, upcoming_events: true, key: auth
@@ -29,6 +31,12 @@ function finish (events) {
}
var region = yml.getRegion(countryMap[event.country])
if (!region.meetups) region.meetups = []
+ custom.some(elem => {
+ if (event.id === elem.id) {
+ event = merge(event, elem)
+ return true
+ }
+ })
clean(event)
yml.replace(region.meetups, 'name', event.name, event)
})
diff --git a/package.json b/package.json
index fb04c03..9e9f611 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
"html-to-text": "^1.5.0",
"js-yaml": "^3.4.5",
"junk": "1.0.2",
+ "lodash.merge": "^3.3.2",
"map-async": "0.1.1",
"marked": "0.3.5",
"metalsmith": "2.1.0", so you can simply add your customized event in |
When we pull data in from another source we consider that resource the source of truth for that information. If we want the local copy to be the source of truth we should add a flag in the markdown and make sure our scripts honor it and don't overwrite it. I don't think we should try and merge information we have locally with information we pull from another source, that's going to get messy :) |
Can we just simply include two md files: one is generated from the script and the other is not? |
@@ -16,6 +17,22 @@ exports.getRegion = function (region) { | |||
return reg | |||
} | |||
|
|||
exports.isSoT = function(region, city) { | |||
for (var reg in store.regions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we reuse exports.getRegion
?
@nodejs/website @pin3da What's the status of this PR? |
- Using getRegion now - Identifying meetups by region, city and name Conflicts: events/yaml-sync.js
@fhemberger I just fixed the conflicts. I also added the @lpinca 's suggestions. Let me know if there is something missing/wrong. Thank you (: |
@@ -29,7 +29,9 @@ function finish (events) { | |||
const region = yml.getRegion(countryMap[event.country]) | |||
if (!region.meetups) region.meetups = [] | |||
clean(event) | |||
yml.replace(region.meetups, 'name', event.name, event) | |||
if (!yml.isSoT(region, event.city, event.name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use region.meetups
here instead of region
?
Left some comments but LGTM. |
All good here, 🚢 ? |
aye |
Thank you @pin3da! |
Thank you all 😺 |
We don't use the meetup.com platform at this moment. It would be cool if you use http://pereirajs.org as referral page.
Let me know if we need to write the data in another format.
Thanks (: