Skip to content

A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.

License

Notifications You must be signed in to change notification settings

torresflo/PyReal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license PRs Welcome GitHub contributors GitHub issues

PyReal

A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.
Report a bug or request a feature

Table of Contents

Getting Started

For users, you can just download the latest release and run it! Following information are mainly for developers.

Prerequisites and dependencies

This repository is tested with Python 3.7+.

You should install PyReal in a virtual environment. If you're unfamiliar with Python virtual environments, check out the user guide. First, create a virtual environment with the version of Python you're going to use and activate it.

Then, you will need to install the dependencies of the project:

pip install -r requirements.txt

Installation

Follow the instructions above then clone the repo (git clone https:://github.com/torresflo/PyReal.git). You can now run main.py to test the API or just write your own application.

Usage

API

The API is currently in development.

The goal of the API is to be able to retrieve data from BeReal (read-only), it is not planned to add write features like posting a photo or creating a comment.

Here are the current implemented and planned features:

  • Past posted photos (Memories)
  • Profile and User info
  • Current Feed (Friends and Discovery)
  • Reactions (RealMojis)
  • Memories Video

Here is a small example of how to use the API:

from API.BeRealAPI import PyReal

pyReal = PyReal()
pyReal.connect(<phoneNumber>) # Process the connection

if pyReal.isConnected():
    # Retrieve connected user info in form of a ConfidentialUser object
    pyReal.getUserInfo()

    # Retrieve friends list in form of an array of User object
    pyReal.getFriends()
    # Retrieve friend suggestion list in form of an array of FriendSuggestion object
    pyReal.getFriendSuggestions()
    # Retrieve sent friend requests list in form of an array of FriendRequest object
    pyReal.getSentFriendRequests()
    # Retrieve received friend requests list in form of an array of FriendRequest object
    pyReal.getReceivedFriendRequests()
    
    # Retrieve memory list in form of an array of Memory object
    pyReal.getMemories()
    # Retrieve friends feed in form of an array of Post object
    pyReal.getFriendsFeed()
    # Retrieve discovery feed in form of an array of Post object
    pyReal.getDiscoveryFeed()

Application

A small application (main.py) can be used to access the features.

On the first launch, it will ask for your phone number in the E614 format: +[country code][number]. Then it will ask you to enter the OTP (one time password) that you will receive on this phone number. This will allow the program to retreive your token and establish the connection with BeReal under your account.

⚠️ Your token will be stored in saved\token.txt, do not share it!

With the current version, the program will automatically download all your posted photos (Memories). Images are stored in saved\photos and are composed of both the front and back photos of each post.

Troubleshooting

A common issue is to fail to send the phone number at the first step. This is usually due because quota was exceeded in the BeReal API. In this case, just retry until it works (it could take a couple of retry).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

About

A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages