<commit_before># Scraping Screenshots of Google Opinion Rewards Data

Google Opinion Rewards lets you view your reward history within the Android app, but only as an image and with no way to export to a text format. 

Since images of tabular data are a common annoyance it seemed like it could be interesting to use OCR to exract this data and possibly reuse for something else later. 

This script uses tesseract-ocr and python to extract the data from screenshots and format into a csv file.

------------------------
### Note: [tesseract](https://github.com/tesseract-ocr/tesseract) is required in order for this to work.

 I am not sure if a Windows version of tesseract is available, but the following will install tesseract on Debian Linux distros:
 
 ```
 sudo apt-get install tesseract-ocr
 ```
 
 This script is written for python 3x, but could easily be modified for python 2x if needed.
 
 The required python packages are all standard library and this was able to run on a Raspberry Pi.
 
 --------------------
### To try it out:
* Take screen shots of your rewards history data and put them in the ./screenshots directory


![example screenshot](screenshots/Screenshot1.png)
* Run:
```
python ./get_rewards_data.py
```
* A timestamped csv file will be placed placed in the current directory<commit_msg>fixing image size in readme markdown file<commit_after># Scraping Screenshots of Google Opinion Rewards Data

Google Opinion Rewards lets you view your reward history within the Android app, but only as an image and with no way to export to a text format. 

Since images of tabular data are a common annoyance it seemed like it could be interesting to use OCR to exract this data and possibly reuse for something else later. 

This script uses tesseract-ocr and python to extract the data from screenshots and format into a csv file.

------------------------
### Note: [tesseract](https://github.com/tesseract-ocr/tesseract) is required in order for this to work.

 I am not sure if a Windows version of tesseract is available, but the following will install tesseract on Debian Linux distros:
 
 ```
 sudo apt-get install tesseract-ocr
 ```
 
 This script is written for python 3x, but could easily be modified for python 2x if needed.
 
 The required python packages are all standard library and this was able to run on a Raspberry Pi.
 
 --------------------
### To try it out:
* Take screen shots of your rewards history data and put them in the ./screenshots directory

<a href="url"><img src="./screenshots/Screenshot1.png" align="left" height="243" width="430" ></a>
* Run:
```
python ./get_rewards_data.py
```
* A timestamped csv file will be placed placed in the current directory
{'fraction_non_alphanumeric': 0.08687615526802218, 'fraction_numerical': 0.0044362292051756, 'mean_word_length': 3.540268456375839, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '695174', 'n_tokens_mistral': 746, 'n_tokens_neox': 691, 'n_words': 392}