Code Monkey home page Code Monkey logo

pigeon's Introduction

Pigeon

An accessible way to access public data from the bird app using your keyboard to interface with the company's interface.

API Reference

getTweet

Get a tweet by ID.

Returns

  • text
  • username
  • postedAt
{
  status: 'ok',
  requestedAt: '2023-01-23T03:47:58.449Z',
  data: {
    text: 'are there any communities out there for discussing the tech behind @CommunityNotes? \n' +
      '\n' +
      '#communitynotes',
    username: 'clairefroe',
    postedAt: '2023-01-22T23:51:12.000Z'
  }
}

Get user

Get a user by username

Returns

  • username
  • followers (count)
  • following (count)
{
  status: 'ok',
  requestedAt: '2023-01-23T03:47:58.449Z',
  data: {
    username: 'clairefroe',
    bio: ' full stack dev\n' +
      ' cross-pollinator of Discord #random channels\n' +
      ' Student Programs @ Postman'
    following: 408,
    followers: 393
  }
}

Errors

If any data is missing or something goes wrong, status: 'error' will be returned. This means it's time to update to htmlHandler.js...

Here's an example error message for getTweet when no username data was found

{
  status: 'error',
  requestedAt: '2023-01-23T03:47:58.449Z',
  message: 'Failed to find data for propertie(s) \'username\'. Twitter may have changed it\'s UI - time to debug!'
}

Debugging

This script uses HTML parsing to get what you need, and is therefore subject to the whims of the web designers at bird company. Here's how you can update

Handling data retrieval

Edit the htmlHandlers.js file if things change up on the bird website UI and data needs to be retrieved otherwise

Handling repsonse

Edit line 14 of index.js to handle the response data as you like. By default the response is simply logged to the console.

Debug

Set screenshotPreviewEnabled to true in config.js to see what the browser sees.

pigeon's People

Contributors

clairefro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.