Skip to content

πŸ‡§πŸ‡¦ A directory of inspiring Bosnians and Herzegovinians in the IT industry.

License

Notifications You must be signed in to change notification settings

malcodeman/bosnianswho.design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bosnianswho.design πŸ‡§πŸ‡¦

code style: prettier GitHub license

Bosnians Who Design is a directory of accomplished Bosnians and Herzegovinians in the IT industry.

Screenshot

Getting started

git clone https://github.com/malcodeman/bosnianswho.design
cd bosnianswho.design
yarn install
yarn dev

.env.development.local:

TWITTER_TOKEN=token

Static file serving

Before running

yarn out
yarn serve

you need to remove i18n property from the next.config.js file because internationalized routing does not integrate with next export.

Index page getStaticProps explanation

1. Getting followers

const followings = await listTwitterFollowings();

We run GET /2/users/:id/following endpoint to get a list of users the @bosniansdesign is following.

2. Getting usernames

const usernames = splitEvery(
  100,
  map((item) => item.username, followings)
);

We split usernames into slices of 100 items each because of the GET /2/users/by endpoint usernames query parameter limit.

3. Getting info

async function getTwitterDesigners(
  usernames: string[][],
  index: number,
  designers = []
): Promise<TwitterDesigner[]> {
  if (equals(index, length(usernames))) {
    return designers;
  }
  return getTwitterDesigners(
    usernames,
    inc(index),
    concat(await listTwitterDesigners(usernames[index]), designers)
  );
}

const twitterDesigners = await getTwitterDesigners(usernames, 0, []);

We run GET /2/users/by endpoint to get created_at,location,url,description,verified,profile_image_url,entities information about users specified by their usernames.

4. Getting designer positions

const designers = map((item) => {
  const description = split(" ", toLower(item.description));
  const positions = flatten(map((item) => item.value, constants.POSITIONS));
  const inter = intersection(description, positions);
  return {
    ...item,
    position: inter,
  };
}, twitterDesigners);

We map twitter users to assign appropriate positions based on twitter description.

5. Getting filter positions

const positions = map((position) => {
  return {
    ...position,
    count: count(
      (designer) =>
        any((item) => includes(item, position.value), designer.position),
      designers
    ),
  };
}, constants.POSITIONS);

We map initial positions and run count function for every designer position.

License

MIT

About

πŸ‡§πŸ‡¦ A directory of inspiring Bosnians and Herzegovinians in the IT industry.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published