This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DannySMc's profile picture

A social networking system for ComputerCraft?

Started by DannySMc, 12 March 2015 - 03:47 PM
DannySMc #1
Posted 12 March 2015 - 04:47 PM
UPDATE:
This now has the API working and I am just testing the PHP scripts to make sure they output exactly what I want :D/>, if you wish to see the source go to my: GitHub and problems submit an issue :D/>

I have an idea, a social network for ComputerCraft (OTHER THAN THE FORUMS) which can be accessed via the Computers in Minecraft.

I have looked into working with the Twitter/Facebook and use it with ComputerCraft and I just thought maybe it would be cooler to have our own version as a community?

These are the ideas I have, please do tell me if you like them if not just say, any things that could be added then I can do that:

+ A login system which will of course use the CCSystems PHP scripts I made (which is what all my OS's use as well as Blaze Email Client and of course the App Store I made), this means that we don't have to keep making accounts for each online/http based program I make.

+ A tweet (Twitter) based status updates type of system, meaning we can all post tweets, tag a user in it etc. Instead of using following, we all follow each other as I feel this is a better idea as I guarantee many people won't use it so people can scroll through all the tweets, and you can go on profiles to see their tweets, and we can incorporate the hashtags as well (or make our own version).

+ Direct Messages: as blaze email client was taken down due to people misusing it, I plan to use it again but in this new program instead changing it around etc, and making it more of a direct messaging system as well as instant.

+ A small profile/bio about yourself etc, and the option to have a profile photo, this will of course be an image type that I have made as this will work with serialization and stay together upon server to computer transfers.

+ A link to view all your apps on the app store.

It's not all there yet but I wanted to know your opinions and if it is a cool idea or if you won't bother using it? Either or I would love to hear ideas to maybe make it better? etc.

Cheers,
Danny
Edited on 18 March 2015 - 11:18 AM
Wojbie #2
Posted 12 March 2015 - 08:20 PM
@Wojbie #Mining is done. Come get me - Your Turtle


And in seriousness it sounds like interesting if not big project. If you feel like making that? Go for it.
Edited on 12 March 2015 - 07:23 PM
Ducky #3
Posted 12 March 2015 - 08:27 PM
Reddit has a really good API, maybe you should write a Reddit Client?
DannySMc #4
Posted 12 March 2015 - 10:21 PM
I like the idea of reddit, maybe,

And not to big tbh, about a few days work, but I just want to see if people would use it:') thanks for the replies though!!
_removed #5
Posted 13 March 2015 - 07:25 PM
I'd quite like the idea of a CC social networking system, as it could be VERY useful indeed. CCBook?
DannySMc #6
Posted 14 March 2015 - 12:19 AM
I'd quite like the idea of a CC social networking system, as it could be VERY useful indeed. CCBook?

Yeah thought it would be cool :D/> but not sure on CCBook though, was thinking SocialNet? Make it web based too?
cdel #7
Posted 14 March 2015 - 02:23 AM
I have actually had a lot of experience, I have made an unreleased program which kinda functions like twitter. Anyone can post a "tweet" and anyone can view them.
nitrogenfingers #8
Posted 14 March 2015 - 10:49 AM
These forums are getting ridiculously big, and there are so many independent platforms and managers and systems being used it's hard to necessarily find what you want within the hundreds of programs we have on the forums now.

Some sort of cross-platform social networking tool could be a great way to make not only projects being worked on in computercraft but existing libraries of programs more accessible to everyone in a social way. It would be a great way to connect with other developers or users of computercraft, certainly less cumbersome. Fully support this idea :)/>
DannySMc #9
Posted 15 March 2015 - 12:14 AM
These forums are getting ridiculously big, and there are so many independent platforms and managers and systems being used it's hard to necessarily find what you want within the hundreds of programs we have on the forums now.

Some sort of cross-platform social networking tool could be a great way to make not only projects being worked on in computercraft but existing libraries of programs more accessible to everyone in a social way. It would be a great way to connect with other developers or users of computercraft, certainly less cumbersome. Fully support this idea :)/>

Well if you want I am looking at working on it sort of Monday, so any ideas on what we need I can start making the database and tables, and then start on the PHP scripts :P/> so yeah just PM me with some ideas, maybe we can make a github type of social network, allowing users to have like projects that everyone with access can update etc? Who knows, endless possibilities :D/>

I have actually had a lot of experience, I have made an unreleased program which kinda functions like twitter. Anyone can post a "tweet" and anyone can view them.


That's cool, have a new idea that works with a website too, I am looking at adding multiple platform ideas into one, that works on web and on CC, but it's cool you've made something like it :)/> post it on my store :P/> maybe more people will look at it? xD hoping to get it recognised tbh ;)/> self promotion, can't blame me ;)/>

An update on this post I have planned to make a lot to it adding things like twitter for posts and stuff, while adding the functionality of being able to post apps etc, but also using facebooks profile type idea while retaining the look and feel of github, maybe even add version control and stuff (exactly like git bash) xD Any ideas do post :P/> would be awesome to hear them ;)/>
cdel #10
Posted 15 March 2015 - 12:35 AM
I think you should just implement a bunch of protocols then make an application around that, then perhaps, people could make various programs that are all in sync with a single user base.
DannySMc #11
Posted 15 March 2015 - 02:42 AM
I think you should just implement a bunch of protocols then make an application around that, then perhaps, people could make various programs that are all in sync with a single user base.

My plan is to publish an API:D
_removed #12
Posted 15 March 2015 - 11:04 PM
Your probably going to say no, but I would like to help you with PHP as I have created the PHP for http://retroservices.16mb.com (im not a web developer) and am very experienced with SQL/HTML/CSS/PHP/PDO.
oeed #13
Posted 15 March 2015 - 11:14 PM
I think this would be a good idea. I'd be interested in making a client for it.

The main thing I'd like to see is a chat, with both individuals, groups and also a global chat. I'm envisaging an iMessage type thing really. It'd be good to also be able to chat online too.

So yeah, once you've got some of the web stuff done give me a yell and I can make a shiny Bedrock program for it :P/>
DannySMc #14
Posted 16 March 2015 - 12:27 AM
Yes I am gonna make the backend myself, as there is no way I'm gonna release logins and that anyone, although I shall make the API for people.

OEED: yeah that's awesome! Will give you a shout when I have the majority of the code working!:)/>
DannySMc #15
Posted 16 March 2015 - 11:43 AM
I think this would be a good idea. I'd be interested in making a client for it.

The main thing I'd like to see is a chat, with both individuals, groups and also a global chat. I'm envisaging an iMessage type thing really. It'd be good to also be able to chat online too.

So yeah, once you've got some of the web stuff done give me a yell and I can make a shiny Bedrock program for it :P/>

On this I have made the tables as so:
cc_profiles:
+ id
+ username
+ full_name
+ date_of_birth
+ bio
+ Forums username

cc_posts:
+ id
+ username
+ header
+ message
+ timestamp
+ origin

cc_chat_global:
+ id
+ username
+ message
+ timestamp

cc_chat_personal:
+ id
+ fromuser
+ touser
+ message

cc_chat_group:
+ id
+ groupname
+ username
+ message

cc_mail:
+ id
+ username
+ subject
+ message
+ timestamp
+ recipient

Is there anything else you wish to add?
DannySMc #16
Posted 16 March 2015 - 11:51 AM
- snip -

This will all work! I just need to know if you want to add anything else to the tables?
oeed #17
Posted 16 March 2015 - 11:56 AM
Timestamps for all messages would be good. The time seen would be good too. You could just have it null when not seen.

How will the mail differ from messages? It'd probably be simpler for you to just use messages rather than both. But up to you of course.

Edit: also, are you using PDO? If not I highly recommend you do.
Edited on 16 March 2015 - 10:57 AM
cdel #18
Posted 16 March 2015 - 11:57 AM
on cc_profiles you may want to add "friends" or something similar so if a cc facebook existed, you wouldn't see posts from every user.
DannySMc #19
Posted 16 March 2015 - 12:11 PM
Timestamps for all messages would be good. The time seen would be good too. You could just have it null when not seen.

How will the mail differ from messages? It'd probably be simpler for you to just use messages rather than both. But up to you of course.

Edit: also, are you using PDO? If not I highly recommend you do.

I am using PDO :)/> and yeah I see yeah probably I was actually going to remake my email system :P/>

on cc_profiles you may want to add "friends" or something similar so if a cc facebook existed, you wouldn't see posts from every user.

A question, how do wish to save every friend as? a lua table in the database?
cdel #20
Posted 16 March 2015 - 12:19 PM
A single table containing all the users friends would be best, but may be difficult from the server side.
DannySMc #21
Posted 16 March 2015 - 12:21 PM
A single table containing all the users friends would be best, but may be difficult from the server side.

Yeah will have a look into it :D/>
oeed #22
Posted 16 March 2015 - 12:21 PM
A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.
DannySMc #23
Posted 16 March 2015 - 12:23 PM
A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

Although I hope one of you kind fellows has a loving JSON decode function :D/>
DannySMc #24
Posted 16 March 2015 - 12:28 PM
Just for help, each request from the server that is a get type that will get like messages, or users or apps etc, or even get a profile, will come back as a Lua formatted array, so all you would do is readAll and then unserialize :D/>
TurtleHunter #25
Posted 16 March 2015 - 02:12 PM
A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

Although I hope one of you kind fellows has a loving JSON decode function :D/>

Latest CC has one :P/>
DannySMc #26
Posted 16 March 2015 - 02:21 PM
A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

A single table containing all the users friends would be best, but may be difficult from the server side.

You could just do a JSON array of IDs.

Yeah thinking of it, would be useful!

Although I hope one of you kind fellows has a loving JSON decode function :D/>

Latest CC has one :P/>
It does?
MKlegoman357 #27
Posted 16 March 2015 - 08:30 PM
It does?

Not decoding, encoding only.
oeed #28
Posted 16 March 2015 - 08:48 PM
Regarding JSON, I simply meant as server side storage. You just have an array like this: [1, 4, 16, 28] and then when you get a user's profile you then turn it into an array of the actual profiles. You should avoid send JSON if you can.

I've got a function that textutils.serialises in PHP from the CC App Store you could use if you wanted.
TheOddByte #29
Posted 16 March 2015 - 09:16 PM
I actually started with a project like this a long time back, but it was through rednet and flickered a lot. This seems like a great idea and I fully support it, I wish I could help out but I won't have the time sadly, because school and other projects are taking up too much time, so I'll be in the shadows secretly watching this project :P/>

Edit: Found the old project, it was hidden on mediafire! Here's the link if you wanna check it out http://www.mediafire.com/download/p38b2rtoueb4tcw/CakeBook.zip
Edited on 16 March 2015 - 08:44 PM
_removed #30
Posted 16 March 2015 - 10:06 PM
Your probably going to say no, but I would like to help you with PHP as I have created the PHP for http://retroservices.16mb.com (im not a web developer) and am very experienced with SQL/HTML/CSS/PHP/PDO.
DannySMc #31
Posted 16 March 2015 - 11:01 PM
Your probably going to say no, but I would like to help you with PHP as I have created the PHP for http://retroservices.16mb.com (im not a web developer) and am very experienced with SQL/HTML/CSS/PHP/PDO.

You guessed it! Thanks anyway! The PHP I will be making as this is not just for the ComputerCraft, it is for a wide range of programs :D/>

I actually started with a project like this a long time back, but it was through rednet and flickered a lot. This seems like a great idea and I fully support it, I wish I could help out but I won't have the time sadly, because school and other projects are taking up too much time, so I'll be in the shadows secretly watching this project :P/>

Edit: Found the old project, it was hidden on mediafire! Here's the link if you wanna check it out http://www.mediafire...cw/CakeBook.zip

Haha nice, I have so many plans, although I am extending this to node.js and a few CGILua platforms when I have finished :D/>
DannySMc #32
Posted 16 March 2015 - 11:18 PM
Your probably going to say no, but I would like to help you with PHP as I have created the PHP for http://retroservices.16mb.com (im not a web developer) and am very experienced with SQL/HTML/CSS/PHP/PDO.

I would also like to point out, where is the website? The content of that page is basic HTML markup language? There is no design? I am not ripping you, it's nice you want to help, but more experience is a lot helpful, and being able to make some basic scripts…? This is a full framework I am making not a few PHP scripts :D/> but it's cool none the less, will have to show me the bank though, like the idea :D/>

Regarding JSON, I simply meant as server side storage. You just have an array like this: [1, 4, 16, 28] and then when you get a user's profile you then turn it into an array of the actual profiles. You should avoid send JSON if you can.

I've got a function that textutils.serialises in PHP from the CC App Store you could use if you wanted.

Will see as I am okay with working with PHP arrays for now, but If it would be better to use it I shall give you a shout, thanks :D/>
_removed #33
Posted 20 March 2015 - 04:00 PM
Your probably going to say no, but I would like to help you with PHP as I have created the PHP for http://retroservices.16mb.com (im not a web developer) and am very experienced with SQL/HTML/CSS/PHP/PDO.

I would also like to point out, where is the website? The content of that page is basic HTML markup language? There is no design? I am not ripping you, it's nice you want to help, but more experience is a lot helpful, and being able to make some basic scripts…? This is a full framework I am making not a few PHP scripts :D/> but it's cool none the less, will have to show me the bank though, like the idea :D/>

I'm gonna be really honest, but I'm looking for a web designer that can make a really simple but effective framework for it. If you want to try it out, maybe me and Jasper will let you use it when it is finally finished. All I do is make the scripts and I can send you a tutorial for how to use the PHP API and the Lua API.

EDIT: here are screenshots of the PHPMyAdmin and PHP code:

http://puu.sh/gIbty/49bcea8e2e.png

http://puu.sh/gIbxE/c66d15488b.png

http://puu.sh/gIbAT/b68c95a1e3.png

http://puu.sh/gIbDZ/b4cc22d48f.png

http://puu.sh/gIbFv/3511b7110d.png
Edited on 20 March 2015 - 03:08 PM
SquidDev #34
Posted 20 March 2015 - 05:55 PM
EDIT: here are screenshots of the PHPMyAdmin and PHP code:


$query = $mysqli->prepare("SELECT password FROM users WHERE username = '$username'");
$query->execute();

Why don't you do:


$query = $mysqli->prepare("SELECT password FROM users WHERE username = ?");
$query->bind_param("s", $username);
$query->execute();

This gives you automatic SQL injection prevention and helps keep things nicer. If you use the statement lots (in one request) you only need to prepare it once and then can execute it multiple times.
_removed #35
Posted 20 March 2015 - 07:14 PM
EDIT: here are screenshots of the PHPMyAdmin and PHP code:


$query = $mysqli->prepare("SELECT password FROM users WHERE username = '$username'");
$query->execute();

Why don't you do:


$query = $mysqli->prepare("SELECT password FROM users WHERE username = ?");
$query->bind_param("s", $username);
$query->execute();

This gives you automatic SQL injection prevention and helps keep things nicer. If you use the statement lots (in one request) you only need to prepare it once and then can execute it multiple times.

Thanks SquidDev, I actually understand what you written for a change! (No offence)! But yeah, I forgot the bind params function :P/>