RenTweet - Twitter Framework for Ren'Py games. (1.0 Release)

Finished games are posted here, once they've been tested and are ready for wide release.
Forum rules
Adult content should not be posted in this forum.
Post Reply
Message
Author
User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

RenTweet - Twitter Framework for Ren'Py games. (1.0 Release)

#1 Post by LordShiranai » Fri Aug 20, 2010 4:18 pm

I am making version 1.0 of RenTweet available now that 6.11.0 is official.
Rentweet-1.0.zip
(8.25 MiB) Downloaded 163 times
RenTweet is a framework which is built upon the Tweepy Python library, and allows for Twitter status updates within games. The purpose is to allow players to update their friends about their progress in a game, and at the same time will hopefully help to promote your game and Ren'Py.

As Twitter no longer allows for simple authentication (storing a username and password), this framework uses OAuth to handle authentication. The auth information provided once a user approves the application is stored in a persistent variable. RenTweet is released under the MIT license, which means that you are welcome to use it in your games or modify it as you see fit.

Usage:
RenTweet is only supported with Ren'Py 6.11.0, as it makes use of the new screen functionality.

To play the short Demo included, unzip the RenTweet folder and place it within your Ren'Py projects directory to play it. On the demo game's main menu, you should see a "Twitter Options" menu option where you can configure Twitter (this can also be set up while right clicking during the game). If you have done this, it will prompt you to send a Twitter status update towards the end of the demo.

To utilize the framework in your own games, copy the files listed in the README.txt to your own project's folder and make the necessary adjustments to the rentweet_game_info method.

If you want to register your game as as its own Twitter app, which I highly recommend if you are making a commercial project and/or you make heavy modifications to this code, you must also modify the rentweet_public_keys to use your own API keys.

To send a status update from within the game, simply use the following code:

Code: Select all

$ Rentweet.tweet("<Your Tweet>")
This will automatically check if or not the user is set up for Twitter, and if so, prompt them to permit the update. (They will not see anything if they haven't configured Twitter.)

I am currently looking for feedback and suggestions on any functionality / performance improvements, as well as any bug reports you might have. There are a few things I would like to improve about the Framework in updated releases, but at the moment it is fully functional for basic status updates. I will probably be improving the documentation when I get the chance to be a bit more friendly.
Don't Blame Me. I Voted for Vermin Supreme.

Counter Arts
Miko-Class Veteran
Posts: 646
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#2 Post by Counter Arts » Fri Aug 20, 2010 11:12 pm

Wow... this could be really useful. Combining this with hashtags and achievements would be really cool.
Fading Hearts is RELEASED
http://www.sakurariver.ca

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4109
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#3 Post by azureXtwilight » Sat Aug 21, 2010 9:21 am

Darn, I hope I have twitter. All I have is facebook :D
Image

User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#4 Post by LordShiranai » Sat Aug 21, 2010 10:28 am

azureXtwilight wrote:Darn, I hope I have twitter. All I have is facebook :D
I am considering the possibility of adding Facebook support or making a similar framework for it in the future, but my current focus is on Twitter.
Don't Blame Me. I Voted for Vermin Supreme.

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#5 Post by rinrin » Sat Aug 21, 2010 11:58 am

LordShiranai wrote:I am considering the possibility of adding Facebook support or making a similar framework for it in the future
That would be most appreciated!


I just tried the framework and it looks very promising. However, the demo crashed after launching a browser window and I got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

error: Event queue full

While running game code:
 - script at line 784 of renpy-6.11.0/common/00library.rpy
 - python at line 786 of renpy-6.11.0/common/00library.rpy.
 - script at line 18 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy
 - python at line 27 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy.
 - python at line 238 of C:\renpy-6.11.0\Rentweet/game/rentweet.rpy.

User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#6 Post by LordShiranai » Sat Aug 21, 2010 2:47 pm

Thanks for the report. I have a couple more questions on this area since I can't seem to reproduce this issue:

1. What platform are you running the game from?

2. Did the browser window actually open? (It sounds like it probably didn't.)

3. Were you launching the option from the title screen menu, or within the game (right clicking)?

4. Was this the very first time you tried to configure Twitter? Or had you gone through the game several times, possibly used
rollback, etc.?

5. Also, just to be sure, are you using the released version of 6.11.0?
Don't Blame Me. I Voted for Vermin Supreme.

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#7 Post by rinrin » Sat Aug 21, 2010 9:23 pm

LordShiranai wrote:1. What platform are you running the game from?
Windows XP
LordShiranai wrote:2. Did the browser window actually open? (It sounds like it probably didn't.)
It did. I even got the PIN.
But the weird part is, RenTweet launched not one but two browsers - Opera and Explorer (Firefox was already running in the background). Nothing happened in Opera (no twitter-related tabs opened), and http://twitter.com/oauth/authorize?oaut ... P0u2oSPZzU opened in Explorer.
LordShiranai wrote:3. Were you launching the option from the title screen menu, or within the game (right clicking)?
Within the game.
LordShiranai wrote:4. Was this the very first time you tried to configure Twitter? Or had you gone through the game several times, possibly used
rollback, etc.?
The first time.
LordShiranai wrote:5. Also, just to be sure, are you using the released version of 6.11.0?
Yes.

User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#8 Post by LordShiranai » Sat Aug 21, 2010 11:55 pm

Okay thanks for the info.

Very weird that it is opening multiple browser windows, as the function being called to do it is supposed to open the default web browser on the OS (not all installed browsers) per the Python documentation (http://docs.python.org/library/webbrowser.html). I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.
Don't Blame Me. I Voted for Vermin Supreme.

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#9 Post by rinrin » Sun Aug 22, 2010 1:25 am

LordShiranai wrote:I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.
I tried several times, the result was always the same. Then I set Firefox to be the default browser (before it was Opera) and it works now - no crashing, even got "Visited Times Square with Rosa!" posted on my twitter account.
Perhaps the function opening a browser window only has problems with Opera? (Although this still wouldn't explain why did it open Explorer on top of that).

User avatar
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#10 Post by shahab96 » Sun Aug 22, 2010 9:24 am

It could be possible that you didn't have a default browser set???
The true measure of a man is what he does with his power.

User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#11 Post by LordShiranai » Sun Aug 22, 2010 9:27 am

rinrin wrote:
LordShiranai wrote:I am not 100% sure that the multiple browser thing is the cause of the problem, or something else entirely.

Since I have yet to reproduce it, I will continue to research this.
I tried several times, the result was always the same. Then I set Firefox to be the default browser (before it was Opera) and it works now - no crashing, even got "Visited Times Square with Rosa!" posted on my twitter account.
Perhaps the function opening a browser window only has problems with Opera? (Although this still wouldn't explain why did it open Explorer on top of that).
I'm glad that you got it to work. It could be an issue with Opera, or could be a messed up default browser setting in the OS somehow. I'm still not sure why it manifested the way it did (filling the error queue), but I will plan on doing some testing with my default browser settings later today to see if I can make the problem reoccur for me and figure out the best fix/workaround.

This is the one area where I would prefer to be using basic authentication for Twitter (which no longer works). Having a user leave the application to go to a web site is annoying, but at the moment I don't seem to have any other option.
Don't Blame Me. I Voted for Vermin Supreme.

User avatar
LordShiranai
Regular
Posts: 188
Joined: Wed Jul 07, 2010 5:49 pm
Completed: Mobile Food Madness, Super Otome Quest
Location: Pacific Northwest
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#12 Post by LordShiranai » Sat Aug 28, 2010 9:39 am

Update on the reported crash: I finally did get the chance to reproduce the issue in a VM. It appears that there clearly is a problem with Opera as the default browser in Windows. This crash does not seem to happen for me if any other browser is set to default. It seems that whatever the underlying Python web browser library is doing is causing the event queue to fill, but only with Opera set to the default.

A possible workaround for Opera users:

1. Set IE as the Default Browser.
2. Set Opera BACK to the Default Browser.

After doing this, I have not been able to reproduce the issue again. The issue may be that something is just somewhat off with how Opera sets itself as the default browser in Windows if you set it up during the Opera install. I could be wrong on this, and I am continuing to work out he issue.
Don't Blame Me. I Voted for Vermin Supreme.

gazornonplat
Newbie
Posts: 12
Joined: Wed May 25, 2011 12:37 pm
Contact:

Re: RenTweet - Twitter Framework for Ren'Py games. (1.0 Rele

#13 Post by gazornonplat » Mon Jun 25, 2012 9:17 pm

I got the following error after adding my own API keys. The included ones didn't work, but didn't crash either, help?
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/rentweet.rpy", line 18, in script
File "game/rentweet.rpy", line 27, in python
File "game/rentweet.rpy", line 262, in python
AttributeError: 'module' object has no attribute 'TweepException'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "/home/peter/Software/renpy-6.13.12/renpy/execution.py", line 265, in run
node.execute()
File "/home/peter/Software/renpy-6.13.12/renpy/ast.py", line 632, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide)
File "/home/peter/Software/renpy-6.13.12/renpy/python.py", line 972, in py_exec_bytecode
exec bytecode in globals, locals
File "game/rentweet.rpy", line 27, in <module>
t = Rentweet.tw_authenticate()
File "game/rentweet.rpy", line 262, in tw_authenticate
except tweepy.TweepException as x:
AttributeError: 'module' object has no attribute 'TweepException'

Linux-3.2.0-25-generic-x86_64-with-debian-wheezy-sid
Ren'Py 6.13.12.1728

Post Reply

Who is online

Users browsing this forum: Bing [Bot]