• 12 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: July 13th, 2023

help-circle




























    1. Settings & Beta -> Data controls -> Export data
    2. Unzip
    Python 3.11.3 (main, Apr 21 2023, 11:54:59) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import json
    >>> with open('conversations.json') as infile:
    ...     convos = json.load(infile)
    ... 
    >>> for convo in convos:
    ...     for key, value in convo['mapping'].items():
    ...         message = value.get("message", None)
    ...         if message:
    ...             parts = message.get("content", {}).get("parts", [])
    ...             for part in parts:
    ...                 if 'text to search' in part:
    ...                     print(part)
    
    1. Customize to taste

    Nice