Skip to content

infoplasma/listener-meetup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meetup RSVP stream listener


The service will connect to the Meetup Long-Polling RSVP stream (Meetup Long-Polling RSVP Stream) and stores the information acquired on a RDBMS database in MariaDb container (linuxserver/mariadb:latest). For information about the database schema, please go to section 7.


1. get_chunk_size

The below function will return an integer with the size in bytes of a stream chunk.

get_chunk_size()

Get the size of a complete event from the stream. :param: none :return: int length of a complete event, in bytes

2. get_chunk_data

Return a chunk from the stream of chunk_size bytes.

get_chunk_data(chunk_size)

Get the 'chunk_size' bytes from the stream :param: chunk_size: http stream data :return: str: return a chunk from the stream of chunk_size bytes

3. iter_listen

The below is a generator function, yielding rsvp events from the stream, as formatted JSON strings.

iter_listen()

:param: none :return: json string

4. listen()

When invoked, this function will start collecting data from the RSVP stream, will filter the portion of data of interest, and make it persistent on the meetup->cities table.

listen()

:param: none

5. create_table

This function will drop the cities table (if exists), and create a new empty table.

create_table()

:param: none

6. filter_data

Within this function we setup the filter in use by the listen() function. It will take the rsvp event JSON string, and return a JSON string subset of that data.

filter_data(data)

:param: json string :return: json string

7. database schema

CREATE TABLE `cities` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `city` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `lat` float(5,2) DEFAULT NULL,
  `lon` float(5,2) DEFAULT NULL,
  `date` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `eid` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `gid` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `mid` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=47322 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

8. Static code analysis results

The code has passed static code analisys with pylint (PEP8) with 10/10 score.

About

Listener for the Meetup API stream

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 85.2%
  • Dockerfile 14.8%