Connect Manialink with Youtube - Where should I start?

Talk about ManiaLink development in this forum

Moderator: NADEO

Post Reply
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Connect Manialink with Youtube - Where should I start?

Post by BigBang1112 »

I want to get some information from my Youtube channel and import it into my Manialink.
Where should I start learning? What library do I need for that?

I know that:
- It will include PHP
- There's a ManiaLib library
Nothing more.

Thanks a lot for answering!
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
zocka
Posts: 205
Joined: 15 Jun 2010, 17:56

Re: Connect Manialink with Youtube - Where should I start?

Post by zocka »

A lot depends on the size of your project. You might not need any library at all.

I lately only create static XML-Manialinks [with a single file but multiple "views" that I hide or display] and load dynamic content with ManiaScript which I get from some backend-script that provides some REST-ish access to my data.
When doing that I sometimes use some processor to compile a template language of my liking (jade/pug for me) into the Manialink-XML, as XML has quite some overhead to type.
When my backend only provides something like GET /api/shoutbox or POST /api/shoutbox I really don't need any fancy routing or framework.


ManiaLib as well as FancyManiaLinks both have an object-oriented approach to markup generation, which is quite some code for very little markup.
The former will probably help you into a cleaner project structure with views and controllers etc., the latter is just for generating the manialink (or maniacode) markup.
Note: I have never used any of these libraries.

If you want to use some template engine instead to write more XML-ish code, there are dozens of alternatives with different syntaxes, phtml probably being the "most native" and most ugly approach as you just can inline too "mighty" code.
Again depending on the size of your project there are multiple frameworks around template engines or you could roll your own project around one, which might end up a bit messy.

I probably should not propose simply inlining php into your markup to get your result, but for my afore-mentioned approach with static XML and maybe including some files or config values it is sufficient.


As for the YouTube thing you will surely find an SDK for PHP and examples. For basic information you can probably even go without bloated stuff like that and find the needed API endpoints somewhere which you then can cURL, but I cannot judge that based on your question.
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Connect Manialink with Youtube - Where should I start?

Post by BigBang1112 »

Thanks for rich answer, means a lot!
I think I'll look into Youtube SDK first. I just wanna get video thumbnails, viewcount, name etc.
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Post Reply

Return to “ManiaLink”

Who is online

Users browsing this forum: No registered users and 1 guest