Tuesday, June 25, 2013

Bing! Rewards Automation version 2.0

In December 2012 was published the first version of Bing! Rewards Automation script. The first blog post can be found here.

This message is to announce script version 2.0. Here is a list of changes:
  1. The script now supports two authentication types - Facebook (which has been there since the first version) and Microsoft Live account.
  2. Accounts are configured in XML file. The default file is config.xml. You may have as many Facebook and Live accounts there as you want.
Sample config.xml

<configuration>
    <accounts>
        <account type="Facebook" disabled="false">
            <login>xxx</login>
            <password>xxx</password>
        </account>
        <account type="Live" disabled="false">
            <login>xxx</login>
            <password>xxx</password>
        </account>
        <account type="Live" disabled="false">
            <login>xxx</login>
            <password>xxx</password>
        </account>
    </accounts>
</configuration>

Parameters are pretty straight forward. Under accounts node you list your accounts with type attribute set to either Facebook or to Live. If you'd like to disable account, just set disabled attribute to true. You may prefer to have a number of config files to store different accounts. To run the script with non default (config.xml) config file, simply run it as

python main.py -f configFile

To see how the script can be executed, run
python main.py -h

The code can be downloaded from my GitHub account

Bing! Rewards Automation script: Unix Cron
Bing! Rewards Automation version 3.0
Configuration for Bing! Rewards Automation script

34 comments:

  1. Should the script write a log file to the "results" folder each time it is run? The only thing I have seen in that folder is an error report when something happens with a certain page (for a search)

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
    Replies
    1. Sorry, accidentally deleted your comment. Here it is again:

      Should the script write a log file to the "results" folder each time it is run? The only thing I have seen in that folder is an error report when something happens with a certain page (for a search)

      Running script on Windows box with Python 2.7.x version.

      My intent is to write the log to my dropbox folder so I can check the status from any pc.

      Delete
    2. and here is the reply:


      The script writes to results folder only if an error occurs. In this case it dumps the entire html which caused an error.

      The script doesn't support redirection of the output to a file yet, but you can do a standard redirection, such as

      python main.py > /path/to/where/i/want/to/store/the/output 2>&1

      which reads as run main.py and redirect the standard output to the file and also redirect standard error stream to the standard output. Essentially you'll get the output (standard and error) to a file of your choice.

      "Using command redirection operators" from Microsoft web page:
      http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true

      Delete
  3. Getting this result today. I don't think I changed anything.

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\User>cd c:\Python27

    c:\Python27>python main.py
    2013-07-04 11:01:04.4 - script started
    --------------------------------------------------------------------------------


    Traceback (most recent call last):
    File "main.py", line 116, in
    earnRewards(accountType, login, password)
    File "main.py", line 35, in earnRewards
    results = bingRewards.process(rewards)
    File "c:\Python27\bingRewards.py", line 219, in process
    res = self.__processSearch(r)
    File "c:\Python27\bingRewards.py", line 157, in __processSearch
    queries = bingQueriesGenerator.parseBingNews(page)
    File "c:\Python27\bingQueriesGenerator.py", line 149, in parseBingNews
    e = newsPage.index(endMarker, s)
    ValueError: substring not found

    c:\Python27>

    ReplyDelete
    Replies
    1. Run the script again. May be run it with --verbose parameter to see an extended output. If that doesn't help that means you are lucky enough to be in a flight (http://en.wikipedia.org/wiki/Flight_(advertising)). I haven't seen that yet. Ran the script last time 12 hours ago. Bing! is constantly changing its HTML. Many people see different results because of flights. Three options here:

      1. This is gonna be a default behavior and/or I will see it one day and fix the code;
      2. This is gonna fade away and the script will work fine for you;
      3. Somebody submits the change which will work with either behavior.

      Delete
    2. Also having the same error as above. One of my accounts works fine but the other one fails.

      I was able to fix it by logging into my account via my browser and running searches. After I ran the script (of course at this point I had all my daily rewards already), and now it wouldn't error out. I will see if it works again tomorrow.

      Delete
    3. Thanks for additional research. Yep, what you are saying only proves my theory. One account works while other one fails. I don't want to register a new account only to track this down. The next time I will be able to earn rewards is tonight or tomorrow. I will see if what you are saying reoccurs with my accounts.

      Delete
  4. Hi all people who've been experiencing this bug,

    It is resolved as of script version 2.5. Just git pull in your command line and enjoy. If you are curious on what have changed, refer to this commit - https://github.com/sealemar/BingRewards/commit/b7a9292c0aef292429fe02935edbf16260e36860

    ReplyDelete
  5. Hey there just wanted first off say thanks this makes life easier. I only have one issue being im running this in windows 7 (laugh now) is that the scheduler seams to have some sort of bug in it. When i run the the script from the scheduler it seams to run for like a millisecond then close. Can you please take a look into this issue and IF you find a fix please reply to this. Thanks for the script very useful being i switched from Ubuntu to windows 7. I MISS CRONTABS. much more simple than windows 7 scheduler.

    ReplyDelete
    Replies
    1. Hi Eric, I'm happy to read what I'm doing is useful. Win 7 with Ubuntu mug on your photo :D -- this is fun.

      I haven't tried Windows scheduler, so I don't have an answer from the top of my head. Also that shouldn't be a big deal. Say, if _at_ hasn't been deprecated in Win 7, then something like this might work:

      at [\\CompName] 06:00 cmd /c "c:\path\to\python.exe c:\path\to\bingRewards\main.py >> C:\path\to\log"

      otherwise, there should be a similar scheduler.

      My point is that if you tried "python.exe main.py" for the scheduler, try cmd /c "python.exe main.py" --- not sure if that will work, though.

      Delete
    2. ehhh thanks and yeah im a contradiction to myself with that ubuntu mug and playing with windows 7 ( AKA Winblows) Whats sad is that prior to 4 years ago you couldn't pry me off windows then i decided to try ubuntu fell in love with it then just as of 4 days ago decided to move back to windows due to i like games and wine just dosent do the trick like it should for me. well i think i better get back on subject. Thanks for the quick reply. I haven't tried the way you described above im kinda out of my element when dealing with cmd on windows hell i just now found out about git so i guess at this level ill call myself a newb. A bit more detailed instruction would be nice. Thanks though for everything. btw if you ever want to come chill in a chatroom check out www.nuphrax.com this is where im at almost 24/7 take care and once again thanks for everything.

      Delete
    3. Well at 2:41AM i can say that the scheduling issue with the script is fixed. Sometimes simplest things are the hardest to figure out. thats all im going to say.

      Delete
    4. Hi Eric, that's not very fair, don't you think so? You posted a question and said you found an answer. That is great! What was that? Thanks for sharing that IRC channel. I will check it later

      Delete
    5. your right its not fair at all, MY BAD. The fix was simple (user error more like it) on the scheduler in windows 7 on the program/script line you simply put main.py and where it says start in (optinal) put the path to the script. Thats it thats the whole fix. it will run the script in the terminal and when its done close the terminal.

      User error, please replace user and press any button to continue.

      Delete
    6. hmm... That makes sense. If you were doing that through a GUI that was exactly why it didn't work without the path, because main.py was sought in the current directory which is either you home directory or windows/system32 if you work under Administrator. Good point.

      Delete
    7. yeah its cool i like this lil script my buddy made a bash script for bing at one point but i dont have it anymore i use this one like its the last one on the planet.

      Delete
  6. Hi, thank you for the terrific post! I was wondering if you know how we can automate the sign up process? thanks

    ReplyDelete
    Replies
    1. Hi Eric, I replied to https://github.com/sealemar/BingRewards/issues/6, let's discuss it there

      Delete
  7. Hey Sergey,

    Great program you have here. Doesn't seem to be working now...script starts and does not login, then ends.

    ReplyDelete
    Replies
    1. What does it output?
      Try running with --verbose option.
      Check results/ directory for any error_*.html
      Usually the script should tell you:
      "Failed blabla, check results/error_*.html for further information"
      Open up that in your favorite web browser. May be the issue is not in the script.
      Also check your config.xml.
      Do you have your information correct there?
      Does the script find your config.xml?
      If not, try main.py -f /full/path/to/config.xml

      Post the update :)

      Delete
    2. command entered:
      ./main.py --verbose -f /home/mainuser/BingRewards-master/config.xml

      Output:

      2013-09-01 18:00:18.2 - script started
      --------------------------------------------------------------------------------


      For: Facebook - email@address.com

      --------------------------------------------------------------------------------
      Total points earned: 0
      2013-09-01 18:00:21.4 - script ended

      No error logs in the results folder, no failure messages. Did the URL for query generation change?

      Delete
    3. Figured it out! Had to recompile the python files. Somehow the permissions were set to root. Works with the new update.

      I'd like to figure out how to tweak the queries generator tho. I'm new to python, so I'm trying to learn more about the coding languuage before doing so. thx for your response.

      Delete
    4. Why do you need to tweak queries generator? It works by parsing Bing! news page and supplying Bing! search engine its own stuff which I found very funny. It's like self satisfied system :) Anyways, all it does it is returns a set of queries to request. You may write your own, of course.

      Delete
    5. The queries generator you wrote works perfectly fine as it is. I want to play with it because I want to learn more about python, and that looks like a good place to start. So right now I'm just tinkering with it to hopefully write my own variation.

      Delete
  8. Check out new posts:
    http://sealemar.blogspot.com/2013/10/bing-rewards-automation-version-30.html
    http://sealemar.blogspot.com/2013/10/configuration-for-bing-rewards.html

    ReplyDelete
  9. I keep getting an error, the script starts but ElementTree.py raises a parse error. I've tried running it with the --verbose option but still no luck. It says it comes from line 249 in main.py. What am I doing wrong?

    ReplyDelete
    Replies
    1. When you ask why something doesn't work it is extremely helpful for you to post the full stack trace of an error, config.xml, OS type (and version) and Python version you use, so that other people can understand what's wrong on your side.

      In that particular situation, I bet your config.xml is incorrect. Double check it.

      Bing Rewards Automation script is an open source project. Python is a scripting language which files you can open up in any text editor. Line 249 of main.py is

      config.parseFromFile(configFile)

      at the moment of your error, which points to your config.xml.

      Delete
    2. Also, one of the most important things to know is the current version of the script you use which you may check with

      main.py --version

      and make sure you always run

      git pull

      first

      Delete
  10. I've noticed a funny thing which is I'm not earning points while searching on Bing! from my home PC, but I earn points perfectly fine from the other location. And that is not connected with Bing! Rewards Automation script, because I don't see it working even if I do a manual search. Also, when I search from home, the search history on Bing! doesn't fill up.

    Has anyone else experienced the same problem?

    ReplyDelete
    Replies
    1. I can earn just fine now. Strange. Looks like Bing! banns IP for a limited time. Good stuff that the script features configurable sleep intervals between taking actions:

      http://sealemar.blogspot.com/2013/10/bing-rewards-automation-script-unix-cron.html

      There is a random sleep between queries, a random sleep after completing one account and starting another and finally there is a random sleep every day before the script starts. All that together highly increases the odds against identifying the script as a bot by Bing!

      Delete
  11. Sergey;

    I have noticed the same issue for a while now. (Glad I am not crazy).

    Today I was playing around and noticed that while the normal searches are affected, if you search using the "images" section you will get points again.

    Not a huge discovery but it will allow you to get some points when your IP address is in a 'time out'.

    Thanks,
    Hieysk

    ReplyDelete
    Replies
    1. It goes into a blacklist from time to time. But eventually it continues working. As for now I don't have any other idea as to increase a timeout between searches. Since it is done by cron, it's not a big deal.

      Delete