Foundation following list to dune

1. run this in dev tool to get the WHERE condition (following list)

const ADDRESS = '0x...' // replace "0x..." to your address
fetch(
  'https://hasura2.foundation.app/v1/graphql', {
  'referrer': 'https://foundation.app/',
  'referrerPolicy': 'strict-origin-when-cross-origin',
  'body': JSON.stringify({
      'query': `
          query UserFollowing($publicKey: String!, $currentUserPublicKey: String!, $offset: Int!, $limit: Int!) {
        user: user_by_pk(publicKey: $publicKey) {
          following(where: {isFollowing: {_eq: true}}, offset: $offset, limit: $limit) {
            user: userByFollowedUser {
              name
              username
              publicKey
              isFollowingUser: follows_aggregate(
                where: {user: {_eq: $currentUserPublicKey}, isFollowing: {_eq: true}}
              ) {
                aggregate {
                  count
                }
              }
            }
          }
        }
      }
    `,
    'variables': {
        'publicKey': ADDRESS,
        'currentUserPublicKey': ADDRESS,
        'limit': 42069,
        'offset': 0
    }
  }),
  'method': 'POST',
  'mode': 'cors',
  'credentials': 'omit'
})
  .then(response => response.json())
  .then(
    ({
      data: {
        user: {
          following = []
        }
      }
    }) => {
      const conditions = following
        .map(({
          user: {
            name,
            username,
            publicKey
          }
        }) => `seller = '${publicKey.replace('0x', '\\x')}' -- ${name} (@${username})`)
        .join("\n" + '  OR ');
      console.log(`(${"\n" + '     '}${conditions}${"\n"})`);
    }
  );
post image

You will get the WHERE condition, copy the output to somewhere.

2. second query for displaying name instead of address on dune

const ADDRESS = '0x...' // replace "0x..." to your address
fetch(
  'https://hasura2.foundation.app/v1/graphql', {
  'referrer': 'https://foundation.app/',
  'referrerPolicy': 'strict-origin-when-cross-origin',
  'body': JSON.stringify({
      'query': `
          query UserFollowing($publicKey: String!, $currentUserPublicKey: String!, $offset: Int!, $limit: Int!) {
        user: user_by_pk(publicKey: $publicKey) {
          following(where: {isFollowing: {_eq: true}}, offset: $offset, limit: $limit) {
            user: userByFollowedUser {
              name
              username
              publicKey
              isFollowingUser: follows_aggregate(
                where: {user: {_eq: $currentUserPublicKey}, isFollowing: {_eq: true}}
              ) {
                aggregate {
                  count
                }
              }
            }
          }
        }
      }
    `,
    'variables': {
        'publicKey': ADDRESS,
        'currentUserPublicKey': ADDRESS,
        'limit': 42069,
        'offset': 0
    }
  }),
  'method': 'POST',
  'mode': 'cors',
  'credentials': 'omit'
})
  .then(response => response.json())
  .then(
    ({
      data: {
        user: {
          following = []
        }
      }
    }) => {
      const conditions = following
        .map(({
          user: {
            name,
            username,
            publicKey
          }
        }) => `        WHEN seller = '${(publicKey || '').replace('0x', '\\x')}' THEN '${(name || '').replace("'", "")} (@${username})'`)
        .join("\n");
      console.log(conditions);
    }
  );
post image

3. fork these queries https://dune.xyz/queries/337651 https://dune.xyz/queries/338794 https://dune.xyz/queries/338811

https://dune.xyz/queries/338678 https://dune.xyz/queries/338730 https://dune.xyz/queries/338737 https://dune.xyz/queries/338987 https://dune.xyz/queries/339019 https://dune.xyz/queries/339021 https://dune.xyz/queries/341166 https://dune.xyz/queries/341230 https://dune.xyz/queries/341233

4. replace “CASE WHEN seller = xxx” and “WHERE seller = xxx” in first 3 queries

5. replace “WHERE seller = xxx” in remain 9 queries

6. create your own dashboard and organize it

7. done ser

might do better SQL next time 🥺