Jump to content




[CC 1.45 - 1.481] ccTwitterFeed v1.02

lua

  • You cannot reply to this topic
24 replies to this topic

#1 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 20 November 2012 - 07:55 AM

Description:
Periodically pulls public tweets from a Twitter account and displays them in a navigable screen.

Posted Image

More Screenshots:
Spoiler

Features:
  • Pulls new tweets in a configurable interval.
  • Auto-Flip: Flips through tweets automatically with a configurable delay.
  • Load tweets from the web or alternatively directly from a file with cached tweets.
  • A (hopefully) self-explanatory usage screen.
  • Color support (only when running from advanced computers, of course).
Instructions:
Spoiler

Download:
Spoiler

Changelog:
Spoiler

Future (unlikely for the time being):
Spoiler

Afterwords:

This is kind of an overdue release as this has been lying around in my MC 1.2.5 folder since march this year.
I originally planned to release it back then, but Uni got me really busy at the time, which also forced me to be absent from the forums for a few months.

Searching through my old progams yesterday I rediscovered it and have retouched it a bit.
I mainly added some color support, changed some condition logic and made use of the keys API.
The core functionality, while untouched, still works with the updated Twitter API v1.1

If you have a question or anything else, drop me a line, as usual. :)
Cheers,
Espen


Edited by Espen, 20 January 2013 - 04:31 AM.


#2 Jasonfran

  • Members
  • 148 posts
  • LocationEngland

Posted 20 November 2012 - 08:11 AM

Nice, I thought about making an actual minecraft mod like that allows you to do this but never got around to it. This is a good alternative

#3 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 20 November 2012 - 08:27 AM

View PostJasonfran, on 20 November 2012 - 08:11 AM, said:

Nice, I thought about making an actual minecraft mod like that allows you to do this but never got around to it. This is a good alternative
Thanks :(/> Do you mean a peripheral, or a pure Minecraft-Mod, independent from ComputerCraft?

Edited by Espen, 20 November 2012 - 08:28 AM.


#4 Jasonfran

  • Members
  • 148 posts
  • LocationEngland

Posted 20 November 2012 - 09:00 AM

View PostEspen, on 20 November 2012 - 08:27 AM, said:

View PostJasonfran, on 20 November 2012 - 08:11 AM, said:

Nice, I thought about making an actual minecraft mod like that allows you to do this but never got around to it. This is a good alternative
Thanks :(/>/> Do you mean a peripheral, or a pure Minecraft-Mod, independent from ComputerCraft?
An independent mod

#5 KillaVanilla

  • Members
  • 303 posts

Posted 21 November 2012 - 06:06 PM

Whoa. This is cool; too bad I don't use Twitter.

#6 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 21 November 2012 - 07:15 PM

View PostKillaVanilla, on 21 November 2012 - 06:06 PM, said:

Whoa. This is cool; too bad I don't use Twitter.
You mean you don't have an account or you don't watch any tweets of somebody else?
Because this is merely for viewing viewing tweets, not for posting them. So you don't necessarily need an account, only the name of a twitter channel. :(/>

#7 flatlinerqz

  • New Members
  • 1 posts

Posted 15 December 2012 - 09:43 AM

I made a slight change to the code on my system. I changed the URL to api.twitter.com/1/MindcrackLP/lists/mindcrackers/statuses.xml. That allows me to see the tweets of all of the mindcrack guys.

#8 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 15 December 2012 - 11:10 AM

View Postflatlinerqz, on 15 December 2012 - 09:43 AM, said:

I made a slight change to the code on my system. I changed the URL to api.twitter.com/1/MindcrackLP/lists/mindcrackers/statuses.xml. That allows me to see the tweets of all of the mindcrack guys.
Yeah, I didn't think of lists at the time and hence didn't look into them at all. Only focused on following individual accounts.
But glad to see it's relatively easy to implement. Also nice to know there is a Mindcrack Twitter list, thx! ^_^

#9 Learning_inpaired

  • New Members
  • 77 posts

Posted 19 December 2012 - 08:20 AM

i got an error...server Http is enabled, tekkit 3.1.2.

ccTwitterFeed:32: bios:267: Attempt to wright to
global: disk/twitter/UTILS

Now befor u bash me, i did give full perms to all the files for this via server side.
but no idea whats going on here

#10 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 19 December 2012 - 09:04 AM

View Postwoodzykiler, on 19 December 2012 - 08:20 AM, said:

i got an error...server Http is enabled, tekkit 3.1.2.

ccTwitterFeed:32: bios:267: Attempt to wright to
global: disk/twitter/UTILS

Now befor u bash me, i did give full perms to all the files for this via server side.
but no idea whats going on here
I just took a look at the CC code contained within Tekkit v3.1.2 and it seems it is using an old ComputerCraft (v1.33).
In that version ComputerCraft is protecting the global table from being modified by programs, that's why it throws that error message for you.

If you CAN update to Tekkit 3.1.3 then I'd suggest doing that, as it contains a more up-to-date version of ComputerCraft (v1.41) that doesn't have that limitation anymore.
Alternatively I'd have to rewrite how I include the UTILS functions, so that it's compatible with older ComputerCraft versions.
If you cannot update then I can give the rewrite a try. But it might take a while before I get some free time from my RL duties.
Maybe the day after tomorrow, that totally depends on certain stuff going on tomorrow.

I'll let you know as soon as I take a look at it. :)

#11 Learning_inpaired

  • New Members
  • 77 posts

Posted 19 December 2012 - 10:05 AM

all right the info, i wont be updateing to tekkit 3.1.3 for now as theres a server-crasher bug with the obsiden pipes atm, i do have the ccTwitterFeed and http enabled on my private server, i it would be easer for you to eather edit it there or jsut do a download from pastebin. maby if i just do an update on computercraft's bios files maby that will work thouhts? i still have the zip from tekkit3.1.3

#12 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 19 December 2012 - 11:20 AM

Only updating the bios.lua? Hmm, that could work. Depends on how much other files depend on stuff that would then be changed.
I'm not at my computer at home, so I can't take a look right now. But I would just test it on a local minecraft copy and see if the computers and their programs still work as intended. I.e. replace the 1.33 bios.lua with the up-to-date one.

But even if that doesn't work I might make ccTwitterFeed compatible with the older versions, will see. :)

#13 Learning_inpaired

  • New Members
  • 77 posts

Posted 19 December 2012 - 01:09 PM

im trying a number of things atm, ill reedit this post to let you know how it went.

EDIT: first i replaced the entire CC mod, no luck..
attempt #2 i replaces the entire lua folder, everything works but same error on your program.
attempt #3 leaveing the previus files, i replaced the class files.. broke it lol...
attempt #4 if = failed
then rs.setbundledOutput("head", event.explode)
end

#14 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 20 December 2012 - 06:45 AM

Ok, found the error for sure now.
Because of the protected global table in v1.33 of CC I can't do a pcall() on dofile() to check for errors.
I just removed the pcall and make a plain call to dofile() without checking for errors.
If dofile() fails for some reason, then there will be an error along the line anyway, so... meh.
But at least it's downward-compatible now. In theory even as far down as the CC version where the HTTP API was introduced.

I tested with a version of CC 1.33 on MC 1.2.5 and also found some other potential problems, like calls to APIs or methods that would be missing in older CC versions (keys, term.isColor, etc.)
I coded in some more thorough checks to allow the use of this program in much older CC versions.

If you don't mind, I'd like you to try again before I update the OP.
The current dev-version is here: Attached File  ccTwitterFeed.zip   11.24K   73 downloads

#15 Learning_inpaired

  • New Members
  • 77 posts

Posted 20 December 2012 - 09:17 AM

all right i can now say that it works very nice to load the tweets, from _jeb!!
also sent you a PM
BUT, it won oad tweets from my own account lol.
i think maby the name is to long? woodzykiler 11 char's
also tryed @woodzykiler and also _woodzykiler oth wont read
ERROR:
ccTwitterFeed:195:
couldnt pull data from twitter.
check screen name or outher parameters
and dont pull to -blah blah blah

#16 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 20 December 2012 - 09:34 AM

Did you pull multiple times in a row perhaps?
Twitter has a limit on how many times you can pull tweets with the API, so you shouldn't pull too many times per minute.
Basically, everytime you start the program it pulls fresh tweets from Twitter. (Except if you use the -F file mode).

But I'll take a look at why it doesn't work with your username.

EDIT:
Just checked your twitter account via web-browser and it seems your tweets are set to private.
ccTwitterFeed only supports public tweets. Otherwise you'd need to log in with a twitter-account and I didn't want to open a can of worms regarding security or just the handling and storing of account data.
Sorry, should've mentioned that in the OP. ^_^

Edited by Espen, 20 December 2012 - 09:40 AM.


#17 Learning_inpaired

  • New Members
  • 77 posts

Posted 20 December 2012 - 11:44 AM

hh ok, well in that case everything shuld eb just fine then :D
nice work

#18 rootbear75

  • New Members
  • 1 posts

Posted 31 December 2012 - 09:38 AM

How do i send the twitter feed to the monitor i have above the computer?
I also want it to automatically flip between tweets

#19 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 31 December 2012 - 11:46 AM

There is a key-map in the instructions of the OP, which shows all available keys. To toggle auto-flip, press T.
To send the output of any program to a connected monitor, make use of the monitor-program:
monitor <SIDE> <PRORGAM> <PARAMETERS>
For more, type:
help monitor


#20 MylesJames

  • New Members
  • 1 posts

Posted 19 January 2013 - 12:21 PM

Hey,


I am really confused how you send the program to run on a monitor, please help. Thanks


Myles





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users