tobilg/facebook-events-by-location

.

Closed this issue · 6 comments

I can hardly believe that a project building on this can have more info than facebook-events-by-location itself... That'd be quite strange.

I'll have a look anyways.

I just checked this, and it returns categories. It's just the case that not all events have a category set, and therefore it is null subsequently.

Using the example query http://localhost:3000/events?lat=40.710803&lng=-73.964040&distance=100&sort=venue returns the following:

{
	"events": [{
		"id": "231292107336574",
		"name": "Psychic Ills, Purling Hiss (solo), Junk Boys",
		"type": "public",
		"coverPicture": "https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/17523033_1873883072860361_2212722631830992389_n.jpg?oh=54a67ff8664a2519396e7c4c2ce429b6&oe=598891A8",
		"profilePicture": "https://scontent.xx.fbcdn.net/v/t1.0-0/c0.22.200.200/p200x200/17523033_1873883072860361_2212722631830992389_n.jpg?oh=cd6f0752129b75ecf6ee710f12010297&oe=598DE025",
		"description": "▁ ▂ ▃ ▅ ▆ ▇ ▉ ▇ ▆ ▅ ▃ ▂ ▁\nFlatBox & Alt Citizen Present\n\nPsychic Ills\nPurling Hiss [solo]\nJunk Boys \nhttps://junkboys.bandcamp.com/releases\n\nTickets: https://www.ticketfly.com/purchase/event/1445829\n21+\nSubscribe to our events here: http://bit.ly/2fAjRpr\n▁ ▂ ▃ ▅ ▆ ▇ ▉ ▇ ▆ ▅ ▃ ▂ ▁",
		"distance": "89",
		"startTime": "2017-04-28T20:00:00-0400",
		"endTime": "2017-04-28T23:59:00-0400",
		"timeFromNow": 1359437,
		"category": null,
		"stats": {
			"attending": 62,
			"declined": 0,
			"maybe": 182,
			"noreply": 193
		},
		"venue": {
			"id": "460616340718401",
			"name": "Baby's All Right",
			"about": "babysallright@gmail.com",
			"emails": ["babysallright@gmail.com"],
			"coverPicture": "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/16300274_1190598481053513_5678512810993788559_o.jpg?oh=dba6f85205e1c39c2b63ef34595116b3&oe=59587314",
			"profilePicture": "https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/1480734_642185745894792_5820988503650852577_n.png?oh=c1b2de32d966516538b97e2d3515af69&oe=5984652D",
			"location": {
				"city": "Brooklyn",
				"country": "United States",
				"latitude": 40.71012,
				"longitude": -73.96348,
				"state": "NY",
				"street": "146 Broadway",
				"zip": "11211"
			}
		}
	}, {
		"id": "275643622860012",
		"name": "Daniel Bachman",
		"type": "public",
		"coverPicture": "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/17350033_10158669599025227_4131069402485456306_o.jpg?oh=ff1e74ed7cf19639361d13d45612e195&oe=5993CCE5",
		"profilePicture": "https://scontent.xx.fbcdn.net/v/t1.0-0/c0.33.200.200/p200x200/17424935_10158669599025227_4131069402485456306_n.jpg?oh=1bb6e973d129d7ef60ffde472e446d1f&oe=59540701",
		"description": "◥◣ Daniel Bachman\n\n== at Baby's All Right\n== 8 PM // $12 // 18+\n\n➟ TICKETS: http://ticketf.ly/2n4zC9r\n\n--\n\nwith love from PopGun Presents\n\nsign up for our newsletter: http://eepurl.com/bntZDT\nsubscribe to our events calendar: http://j.mp/popgunevents\nearn free tickets to popgun shows by signing up for our street team:http://bit.ly/2aa9lPZ",
		"distance": "89",
		"startTime": "2017-06-30T20:00:00-0400",
		"endTime": "2017-06-30T23:30:00-0400",
		"timeFromNow": 6802637,
		"category": "MUSIC_EVENT",
		"stats": {
			"attending": 15,
			"declined": 0,
			"maybe": 33,
			"noreply": 0
		},
		"venue": {
			"id": "460616340718401",
			"name": "Baby's All Right",
			"about": "babysallright@gmail.com",
			"emails": ["babysallright@gmail.com"],
			"coverPicture": "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/16300274_1190598481053513_5678512810993788559_o.jpg?oh=dba6f85205e1c39c2b63ef34595116b3&oe=59587314",
			"profilePicture": "https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/1480734_642185745894792_5820988503650852577_n.png?oh=c1b2de32d966516538b97e2d3515af69&oe=5984652D",
			"location": {
				"city": "Brooklyn",
				"country": "United States",
				"latitude": 40.71012,
				"longitude": -73.96348,
				"state": "NY",
				"street": "146 Broadway",
				"zip": "11211"
			}
		}
	},
        ...
     ]
}

The second event has a category.

I don't really understand what you mean. The category is derived from the event itself, see https://github.com/tobilg/facebook-events-by-location-core/blob/master/lib/eventSearch.js#L203, and not the place.

Also, the categories of the pages don't need to have anything to do with the actual events.

Hello.

I think you are correct in your analysis about the categories @tobilg , but the category in the events most of the times is null.

In facebook.com, in the events page, at the bottom we have the group Categories, I guess they are using Page categories.

Are you open to change your request, adding the fields category and/or category_list (don't know which one is the correct one) to the pulled page information?

Thanks.

@tobilg My app is not using your code. But from you I got the idea of finding events thru the place search. For showing that idea I am grateful.

In my code I am also taking category and category_list from the page of the place listing the event (you call this venue). My idea here is that category of the page often corresponds to type of event.

In the US the events category is nearly always set, but not in Europe. I guess the US-version has category as a mandatory field for event.

/Big

I just pushed the version 0.7.0 which contains the venue.category and venue.categoryList fields.