AngularFire | Make dynamic URL with post ID - facebook

I recently discovered Firebase and I'm currently creating an e-sport website using AngularFire.
In this one, users can sign up with Facebook, search and create video games tournaments (LAN) with several filters (game, location ...).
At the moment, I only did the authentication and the routing, but before make more code, I would like to know if it is possible to create dynamic URL with a post ID and the same template for each post.
For example, I create a LAN (ID : 458) and the url is http://mywebsite/lan/458.
Thank you for your help.

Related

Moodle : is it possible to access user from javascript ONLY

My purpose is simply being able to retrieve basic user info (id, username, lastname, firstname) in javascript on ANY moodle page WITHOUT having to create a plugin.
I've seen that there is a javascript global variable in Moodle : M but no user info in there.
Is there a way to access user info (id at least) from a logged in user on any page only in javascript another way ?
I've tried the generico filter to create a block i would be able to retrieve information from
<span data-firstname="##USER:firstname##" data-lastname="##USER:lastname##" data-userid="##USER:id##" id="useriddata"></span>
But since i want it on any page, i've tried on the Moodle > Extra HTML textarea. Sadly it doesn't work since the HTML seems not to be filtered there.
Creating a plugin for such a small information seems wrong. What can i do ?
You may request user info via Web Services using ajax, e.g. core_user_get_users_by_field. You should, however, determine userid first, which can probably be retrieved from top menu links after signin (profile link etc.). But I would recommend to develop the plugin anyway

Getting a SoundCloud API client ID

Encountered a problem accessing my tracks from browser.
Usually i type this link in my browser to access downloadable tracks:
http://api.soundcloud.com/tracks/294324164/download?client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea
But now i can not access it anymore, probably the client id is changed.
How can i obtain a new client id?
Thanks.
Simple.. Go to any tracks that you can download on soundcloud, press f12 and look at networks tab, click download and it will show you something like
https://api.soundcloud.com/tracks/322109493/download?client_id=2t9loNQH90kzJcsFCODdigxfp325aq4z&oauth_token=2-274121-85658-y9KQYyZ6qG9oT2uvPq
Grab that client_id, replace it and amend the url from download? to stream?.. use streams? if you want a list of urls in json format
http://api.soundcloud.com/tracks/294324164/stream?client_id=2t9loNQH90kzJcsFCODdigxfp325aq4z
As no one else has mentioned it, in a Chrome-based browser under DevTools ctrl+shift+i, you can grab your client_id from the Network tab on reload. Many items listed here reference the SoundCloud API and require your client_id to access it. Simply click any item in the list that isn't an image/base64 item (preferably something that begins with id?...), then check the Request URL for a client_id.
It's the simplest way to grab the ID; now that you know how, don't do anything illegal k thx.
For those thinking this is the same as the other answer mentioning a download link, this method skips that entirely as many songs are no longer available from SoundCloud itself, but from external sources that are linked instead.
Amazing it's been this long, yet there's no "public" Soundcloud API. I'm amazed to find something worse off than the Twitch API.
See this user's solution for a way to do this without a CLIENT ID which you can no longer get from soundcloud: https://stackoverflow.com/a/27461646/179571
youtube-dl https://soundcloud.com/my-fav-artist
seems to work and pull all tracks as mp3
no client_id needed, if you needed the client_id to get something
like soundcloud-dl to work
You can apply for a client ID by filling in the SoundCloud Application Registration form.

Dailymotion callback url dynamic configuration

I hope I am not duplicating a question. I am banging my head against a wall for several days now. I am adding the Dailymotion PHP SDK to our site, I am using the Dailymotion::GRANT_TYPE_AUTHORIZATION, I am able to authenticate using a static call back url in my API on Dailymotion.
I want to be able to use this from several different scripts on the site. The first will be to call a link up page, so we can capture that a person has linked to Dailymotion. The second will be to upload video's through our system to Dailymotion, to that users account, not mine. I know I could do this with the authentication type of password, but I want to use the API and not have to have the visitor sign in or enter their credentials every time.
Back to the question, I see that the API can have a dynamic url, but I can not figure out how to make this work. If I someone could send me an example of how to enter this in the API section I would appreciate it. This does not work:
http://example.com/dailymotion/[dailymotion_checklogin.php]
nor does something like this:
http://example.com/callback/[dailymotion_upload.php][dailymotion_checklogin.php]
I would appreciate any help.
Thanks
Mrpepik
Replace the [dynamic] part with your dynamic part.
If your redirect URI on your API key is http://example.com/dailymotion/[dynamic], then your real redirect URI could be http://example.com/dailymotion/dailymotion_checklogin.php

How to track direct URL referrer

Most hosts come with softwares or google analytics which allows you to know how a person got to your site, for example: a link on yelp.com or a facebook.com page link.
But it is impossible for the software to know what method of marketing got a person to visit your site if he directly typed the url (those analytic softwares show them as "direct url").
I need a creative idea where I can refine this broad term "direct url".
One way would be to use flyers with QR codes (links to the website) but instead of the website itself I direct them to clickemart.ca/flyer1_referrer which in turn sends him to the website clickemart.ca but a different flyer distributed to a different location would have a QR code which can be scanned to direct a mobile user to clickemart.ca/flyer2_referrer
So my question is, is this possible, will I be able to figure out which flyer 1 or 2 was more effective based on visits to the redirect urls? If it is possible can you give me a brief idea on how to implement it?
I know a lot of you will say add a form field with "source of referrer" on the site but from my experience this is never filled or filled with incorrect values (typically the closest to the mouse pointer or the top most option or "other" - you get it, something useless).
Any help or guidance is really appreciated!
Solved it here is how:
Connect your site to Google Analytics (www.google.ca/analytics)
Create a campaign URL (support.google.com/analytics/answer/1033867?hl=en)
OPTIONAL: shorten the URL (www.bitly.com)
Create a QR code to the URL (www.qrstuff.com/)
Scan the QR code and watch it appear as a campaign referral under Google Analytics
Here is an explanation to the different steps:
Once you create an account on Google Analytics, you can connect the site by copying a PHP script or a JavaScript onto every page or in my case (magento) the user code can simply be connected through the configuration settings
The campaign URL adds information to the URL link of your website just like the current link on stackoverflow.com variables such as noredirect="..." contains info for your server to process, so using the campaign URL could be used as a tag to determine the source of the referral
Shortening the URL is recommended because the QR code becomes less dense and this in turn reduces the chance of error while scanning the code, the shortened URL links directly to the campaign URL link you provided so it is a seamless process
QRStuff is a good place to download the QR code image at a high resolution
So when you scan this is what happens:
CODE SCANNED >> PHONE COMMAND TO GO TO SHORTENED URL LINK >> REDIRECT TO CAMPAIGN URL >> GOOGLE ANALYTICS RECEIVES INFO ABOUT CAMPAIGN REFERRAL >> YOU CAN SEE IT BY LOGIN INTO GOOGLE ANALYTICS

How to make facebook crawl correct url on multi market, multi language site?

We have a website with multiple markets and multiple language where we use canonical to avoid duplicate content.
A geoip matching script is used to redirect users to what we guess is their market by looking at their ip.
The problems occurs when we try to add a link on facebook to the site. Facebook crawls the canonical instead of the page url and links to wrong market due to geoip redirect.
Example:
Url /nl-nl/nl/locator
canonical /nl-nl/global/locator
en = language
fi = market/country
When a new user comes to /nl-nl/global/locator, we look at the ip and try to redirect the user to the market that the ip corresponds if the market has the language connected.
So far so good.
The problem is that since the facebook crawler is seen as a new visitor coming to /nl-nl/global/locator with a different ip than the person trying to create the link they wont get the same market and link unless the language is only used in one market and the user isn't in the same country. The content is the same but the market is wrong. instead of /nl-nl/nl/locator the facebook post links to en /nl-nl/be/locator
Essentially I would like facebook to ignore the canonical and use the specified url but I'm not sure if it possible or the correct path to solve this.