├── .gitignore ├── Analysis_Sentiment_Genshin.ipynb ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /Analysis_Sentiment_Genshin.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "provenance": [], 7 | "authorship_tag": "ABX9TyOBqZdGNFn0xwhm9rr4QAHs", 8 | "include_colab_link": true 9 | }, 10 | "kernelspec": { 11 | "name": "python3", 12 | "display_name": "Python 3" 13 | }, 14 | "language_info": { 15 | "name": "python" 16 | } 17 | }, 18 | "cells": [ 19 | { 20 | "cell_type": "markdown", 21 | "metadata": { 22 | "id": "view-in-github", 23 | "colab_type": "text" 24 | }, 25 | "source": [ 26 | "\"Open" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 10, 32 | "metadata": { 33 | "id": "IfIvQBO5Lg-G" 34 | }, 35 | "outputs": [], 36 | "source": [ 37 | "# !pip install app_store_scraper\n", 38 | "# !pip install google_play_scraper\n", 39 | "\n", 40 | "from google.colab import drive\n", 41 | "from google_play_scraper import app, Sort, reviews_all\n", 42 | "from app_store_scraper import AppStore\n", 43 | "\n", 44 | "import pandas as pd\n", 45 | "import numpy as np\n", 46 | "import json, os, uuid\n", 47 | "# drive.mount('/content/gdrive')" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "source": [ 53 | "g_reviews = reviews_all(\n", 54 | " \"com.miHoYo.GenshinImpact\",\n", 55 | " sleep_milliseconds=0, # defaults to 0\n", 56 | " lang='id', # defaults to 'en'\n", 57 | " country='id', # defaults to 'us'\n", 58 | " sort=Sort.NEWEST, # defaults to Sort.MOST_RELEVANT\n", 59 | " )\n", 60 | "\n", 61 | "g_df = pd.DataFrame(np.array(g_reviews),columns=['review'])\n", 62 | "g_df2 = g_df.join(pd.DataFrame(g_df.pop('review').tolist()))\n", 63 | "\n", 64 | "g_df2.drop(columns={'userImage', 'reviewCreatedVersion'},inplace = True)\n", 65 | "g_df2.rename(columns= {'score': 'rating','userName': 'user_name', 'reviewId': 'review_id', 'content': 'review_description', 'at': 'review_date', 'replyContent': 'developer_response', 'repliedAt': 'developer_response_date', 'thumbsUpCount': 'thumbs_up'},inplace = True)\n", 66 | "g_df2.insert(loc=0, column='source', value='Google Play')\n", 67 | "g_df2.insert(loc=3, column='review_title', value=None)\n", 68 | "g_df2['laguage_code'] = 'en'\n", 69 | "g_df2['country_code'] = 'us'\n", 70 | "result = g_df2\n", 71 | "print(result)" 72 | ], 73 | "metadata": { 74 | "colab": { 75 | "base_uri": "https://localhost:8080/" 76 | }, 77 | "id": "EfnaA8G7OH2u", 78 | "outputId": "2830efe2-bf62-4c80-c055-8e06e798acfc" 79 | }, 80 | "execution_count": 11, 81 | "outputs": [ 82 | { 83 | "output_type": "stream", 84 | "name": "stdout", 85 | "text": [ 86 | " source review_id \\\n", 87 | "0 Google Play d8e5f80b-69d6-4697-8dcb-20d22f057b46 \n", 88 | "1 Google Play 35839410-ffa5-4b84-8c83-cd4a17c7d357 \n", 89 | "2 Google Play 3a97f249-ce02-48d6-abc9-5c90357414c6 \n", 90 | "3 Google Play 2c38e5d4-e143-4f43-abc6-b60dfa3451a5 \n", 91 | "4 Google Play 97bd0bce-0b48-434d-876b-5f3797b2ff95 \n", 92 | "... ... ... \n", 93 | "174175 Google Play 23cd0247-8802-4d55-b46a-6993c4852a36 \n", 94 | "174176 Google Play 119af6ce-01bb-47e7-b9ab-45cafc0c40a5 \n", 95 | "174177 Google Play fcfd1ba4-47bb-4b48-ac55-348e3940f3a6 \n", 96 | "174178 Google Play fe007972-d9a6-4b15-aa22-fff75dae0b28 \n", 97 | "174179 Google Play 3d1a5d0b-bf7d-420d-98e4-94ca46288de8 \n", 98 | "\n", 99 | " user_name review_title \\\n", 100 | "0 Aria Abdi None \n", 101 | "1 Raffi Rizqullah None \n", 102 | "2 Aditia Akday None \n", 103 | "3 Ivano Dwindrataftazani None \n", 104 | "4 Diva Audia None \n", 105 | "... ... ... \n", 106 | "174175 MHasan None \n", 107 | "174176 Ramato Ayurigo None \n", 108 | "174177 Fisko Aritmatika Yuri None \n", 109 | "174178 Fahriza Yudha None \n", 110 | "174179 Rian 7440 None \n", 111 | "\n", 112 | " review_description rating thumbs_up \\\n", 113 | "0 Keren uy waifunya wangy wangy 5 0 \n", 114 | "1 Wow game nya sangat bagus alur cerita nya mena... 5 0 \n", 115 | "2 Kepada deplover Genshin Impact, untuk Overall ... 4 34 \n", 116 | "3 Happy 1st birthday 5 0 \n", 117 | "4 Tolong batas poin perabotan di tea pot ditamba... 5 0 \n", 118 | "... ... ... ... \n", 119 | "174175 Saya sangat menantikan game ini, semoga saya b... 5 1 \n", 120 | "174176 Wah gamenya bagus banget Udh open world grafik... 5 2 \n", 121 | "174177 Xixixi 5 1 \n", 122 | "174178 Owh 5 1 \n", 123 | "174179 Niceeeeer 5 3 \n", 124 | "\n", 125 | " review_date developer_response developer_response_date \\\n", 126 | "0 2022-12-29 07:56:19 None NaT \n", 127 | "1 2022-12-29 07:34:15 None NaT \n", 128 | "2 2022-12-29 07:14:19 None NaT \n", 129 | "3 2022-12-29 07:10:51 None NaT \n", 130 | "4 2022-12-29 07:02:45 None NaT \n", 131 | "... ... ... ... \n", 132 | "174175 2020-09-27 04:18:03 None NaT \n", 133 | "174176 2020-09-27 04:15:15 None NaT \n", 134 | "174177 2020-09-27 04:14:24 None NaT \n", 135 | "174178 2020-09-27 04:13:32 None NaT \n", 136 | "174179 2020-09-27 04:12:45 None NaT \n", 137 | "\n", 138 | " laguage_code country_code \n", 139 | "0 en us \n", 140 | "1 en us \n", 141 | "2 en us \n", 142 | "3 en us \n", 143 | "4 en us \n", 144 | "... ... ... \n", 145 | "174175 en us \n", 146 | "174176 en us \n", 147 | "174177 en us \n", 148 | "174178 en us \n", 149 | "174179 en us \n", 150 | "\n", 151 | "[174180 rows x 12 columns]\n" 152 | ] 153 | } 154 | ] 155 | }, 156 | { 157 | "cell_type": "code", 158 | "source": [ 159 | "g_df2.to_csv('genshin_reviews.csv')" 160 | ], 161 | "metadata": { 162 | "id": "CRVf98ugPANj" 163 | }, 164 | "execution_count": 12, 165 | "outputs": [] 166 | } 167 | ] 168 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 mattismyname3011 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # analysis_sentiment --------------------------------------------------------------------------------