{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 108482,\n",
       " 'content': 'Chat, flirt, love!\\ntilmeld dig GRATIS nu:\\n\\nhttps://t.co/5Vk2bxjdqm\\n\\n#Danmark #Århus #Odense #Copenhagen #Denmark https://t.co/3XbIv2jImj'}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from translate import get_untranslated\n",
    "\n",
    "get_untranslated()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'generator' object does not support item assignment",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[2], line 4\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mtranslate\u001b[39;00m \u001b[39mimport\u001b[39;00m yield_untranslated, process_translate\n\u001b[1;32m      2\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mmultiprocessing\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mmp\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m process_translate(yield_untranslated())\n",
      "File \u001b[0;32m~/projects/twitter_scraper/code/translate.py:46\u001b[0m, in \u001b[0;36mprocess_translate\u001b[0;34m(val_dict)\u001b[0m\n\u001b[1;32m     44\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m     45\u001b[0m     content_en \u001b[39m=\u001b[39m \u001b[39m'\u001b[39m\u001b[39m'\u001b[39m\n\u001b[0;32m---> 46\u001b[0m val_dict[\u001b[39m'\u001b[39;49m\u001b[39mcontent_en\u001b[39;49m\u001b[39m'\u001b[39;49m] \u001b[39m=\u001b[39m content_en\n\u001b[1;32m     47\u001b[0m \u001b[39m# upload to database\u001b[39;00m\n\u001b[1;32m     48\u001b[0m insert_translated(val_dict)\n",
      "\u001b[0;31mTypeError\u001b[0m: 'generator' object does not support item assignment"
     ]
    }
   ],
   "source": [
    "from translate import yield_untranslated, process_translate\n",
    "import multiprocessing as mp\n",
    "\n",
    "process_translate(yield_untranslated())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "57b41ea9bda188de64800ef31c5cfb4fcfca577257038becb66e4fa0a5ee97a6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
