YetiPoll for VieFaucet
======================

Paid surveys on your faucet. Your users earn on their balance, you earn
with every completed survey.

What you need: a YetiPoll account with an app (https://yetipoll.com) and
access to the files of your site.


1. Upload one folder
--------------------
Copy the folder "application" from this download over the "application"
folder of your site. It adds two files and changes none:

    application/third_party/yetipoll/yetipoll-viefaucet.php
    application/third_party/yetipoll/yetipoll-postback.php


2. Your keys
------------
Open application/third_party/yetipoll/yetipoll-viefaucet.php. If you
downloaded this while signed in and chose your app, the four keys are
already in it. If you see YP_LIVE_PUBLIC_KEY and the like, replace them
with the keys from the page of your app in the YetiPoll dashboard.


3. Paste two methods
--------------------
paste/Wh.php.txt         into application/controllers/Wh.php
paste/Offerwall.php.txt  into application/controllers/Offerwall.php

Each goes before the last closing bracket } of the file.


4. Add the menu link
--------------------
paste/menu-link.txt goes next to the other offerwall links in
application/views/user_template/template.php.


5. Tell YetiPoll where to send rewards
--------------------------------------
In the YetiPoll dashboard, open your app and set the postback URL to

    https://YOUR-SITE/wh/yetipoll

and nothing else. All values are added for you.


6. Set your currency
--------------------
Set the reward currency of the app in the YetiPoll dashboard so that one
unit is one unit of your users' balance.


7. Check it
-----------
Press "Send a test completion" on the page of your app in the YetiPoll
dashboard. The postback log should show it as delivered, with status
code 200. (403 means a wrong secret key, 503 that the keys are missing.)

To watch a reward arrive on a balance, set YETIPOLL_MODE to 'test' in
yetipoll-viefaucet.php, open the surveys on your site as a user and finish
a practice survey. Set it back to 'live' before real users see it: in
'test' mode practice rewards are added to balances.


How rewards are handled
-----------------------
- Every message is checked to really come from YetiPoll.
- A reward is added once, however often it is sent.
- A reward that is taken back after a quality check is deducted once. It
  is stored next to the reward, under the same id with "-R".
- Rewards are added at once, without a waiting time.


Changing the name
-----------------
Users see "Surveys" in their history. To change it, edit YETIPOLL_LABEL
before the first reward arrives, and the word in the menu link.
