Specify a language when embedding a Spotify playlist using an iframe - localization

Is there a query string parameter (or a special path, or subdomain) that can be used with standard localization codes (e.g. es, nl, de, etc) in conjunction with a url like this https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs that will localize the content from Spotify?
EDIT:
I am referring specifically to the options menu as pictured below as the rest of the text is just artist and track title.

No. In this case Spotify doesn't offer any localization codes. But there is no reason for it because it just give you general information title/artist/album etc.
You have to tell us more specific what you want.
If you want to grab data from this url use web-api instead.
https://developer.spotify.com/technologies/web-api/
Use Lookup if you have a special title/artist/album etc. but you need spotify url!
https://developer.spotify.com/technologies/web-api/lookup/
If I would interpret your question in another way:
You can look up 'availability' for certain 'territories'
Just for you to know there is a rate limiting 10 requests per ip/second!
Hope I could helpya! If you need something else or want more help tell us or write me a message ;)

Related

Programmatically search Youtube videos and return the first available one on a web page

Good day!
Let's say I have a web page dedicated to a specific song by a specific author (eg "Imagine" by "John Lennon"). I would like to programmatically:
Search Youtube for the first n videos with "Imagine John Lennon"
Loop through these results to find a video which is available in the country where the user is located
Display the first video that matches the constraints on point 2. If no video matches them, then I won't display any video.
How can I do this? Is it better to do it with PHP or Ajax calls? I already checked some similar questions (1, 2) but as they are "old" I was wondering if there is a better method now.
Thanks for any help
This can be done with a single call to the Search: list endpoint, setting the 'q' and 'regionCode' parameters. Use any programming language you prefer.

Take Action based on QR code Information of VCARD, iPhone

What is the best way to handle QR code's Information, As QR code can have any information, For now, I want to handle only
1 URL and redirect to safari browser--> its fine
2 vCard and open contact book with contact values, But I'm seeing that VCARDS keys name are not unique(not sure if I'm Having improper QR codes). And also, QR value is a string to how to detect which value is for which key of address book?
e.g:
"BEGIN:VCARD
FN:Ashwin kanjariya
TEL:+999-999-9999
EMAIL:you#we.com
URL:http://www.youandme.com
N:kanjariya;ashwin
ADR:any address
ROLE:software developer
VERSION:3.0
END:VCARD"
So, I'm Not sure for VCARD all keys are universal or not? What is the best way to handle it?
I appreciate your any kind of suggest that can help me to figure out VCARD parsing.
Is CFDataCreate with ABPersonCreatePeopleInSourceWithVCardRepresentation best way to go with?(I have support for below IOS 9 as well)
like
let vCardnsdata = CFDataCreate(nil, UnsafePointer<UInt8>(vCard.bytes), vCard.length)
let addressbookDefaultSrc = ABAddressBookCopyDefaultSource(addressBook)
let vCardPeople = ABPersonCreatePeopleInSourceWithVCardRepresentation(defaultSource.takeUnretainedValue(), vCardData).takeRetainedValue() as NSArray
VCARD has several versions with slightly different implementations, keys don't have to be unique, a person can have multiple home or work phone numbers for example, but you should be able to tell what is a phone number and just accept as many as your customer believes is reasonable for their use case.
An extensive list of what you may find in VCARD's is here: https://en.wikipedia.org/wiki/VCard
If you want to make sure that all the data is stored, then you may have to implement lists, or in database terms, store items in different tables so that one to many relationships can be maintained for several items.
When designing a system to store information about people, you may also want to observe some of the Falsehoods Programmers Believe About Names

SEO: URL for detail page, include categories or not?

I'm working on a new advert website and want to implement some good SEO URLs.
I got category URLs like:
/category
/category/sub-category
This seems ok. What about detail pages?
Option 1:
/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Option 2:
/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
In reality my website has a pretty long URLs due to multiple areas you can shop. So it would become:
/en/area-name/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
/en/area-name/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Which detail page would be a better URL? The first option seems to be better if the product has no long/good title. The second seems better as its the most relevant one and shortest especially with long category names.
I would like to hear your thoughts!
EDIT:
I found this two google docs:
http://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fwww.google.com%2Fwebmasters%2Fdocs%2Fsearch-engine-optimization-starter-guide.pdf&ei=lXyaT6T_L8zR4QSM4c2qDw&usg=AFQjCNEMj8KHxhxQz9cMLoMxMDiLdrAbJw
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329
I think I will be going for /adverts. Anyone disagree?
i have seen many of SEO analysts miss something about optimizing their webpage and that is your page will be optimized for only some keywords not all keywords. it is not important how length is your URL. you should first analyze whether the contents in your webpage is rich enough to have such URL with these keywords or not. if the answer for every keyword is yes then the more length will give you the more rank.
I think you can even set your pages up in a way to use only the slug and skip the id, such as:
/adverts/suscipit-dis-molestie-malesuada-vestibulum-ut
or even just:
/suscipit-dis-molestie-malesuada-vestibulum-ut
like this and refer straight to the adverts controller and the advert itself, which has this slug assigned to it (the one with id 15880).
This way you'll have nice and clean URLs. Just assign and keep an unique slug for each advert and handle it using .htaccess, or dynamically inside the code of your site, if the system allows it.
Cheers.

how to design a tag system for a localized website?

Let say i have a basic tagging system (for a craiglists "clone") such as:
Tag (id, tagname)
ad(id, title, body)
adTag(tag_id, article_id)
This will fit for a non-localized website but what will be the correct aproach for a website that is used by people speaking diferent languages?
Users probably will post ads in diferent languages in one same local area, so, maybe i should make some kind of synonym system that considers "job" and "trabajo" the same tag? But, what about users that only want to see ads in one language?
Catering for tags for all the different languages is probably just going to be trouble. Going with the idea where you treat all variations of a tag as one single type will probably simplify a lot of the issues (so you don't need to keep track of language-tag mappings on the fly, just do the conversion once and be done with it). If the user needs to search by language later on, then just stick a meta-tag for that particular language on when you save the post.
Of course, that leaves the question of what happens when a user uses tags from multiple languages... but I suppose you can always enforce one single language or something.
I can think of two possible solutions:
Add language field: Tag (id, tagname, lang) where you can specify the language for the tag
Change Tag to Tag(id) and use separate table for tag translations tagTranslations(tag_id, lang, tagname)
Note: But I think this is only needed, if your articles have multiple translations.

Django URLs - How to pass in multiple caterories via the clean URL without the need for?

I want to stay way from GET params. Don't want to use POST and I have at least two different categories to build the URL for.
The visitors are first asked to choose a location wich can be one of, for example:
http://foo.com/United-States/ ||
http://foo.com/United-States/California/ ||
http://foo.com/United-States/California/San-Francisco-Region/ ||
http://foo.com/United-States/California/San-Francisco/
Once a location is selected, then they can pick a category which can be one of for example:
http://foo.com/Electronics/ ||
http://foo.com/Electronics/Camera/ ||
http://foo.com/Electronics/Camera/Digital/ ||
http://foo.com/Electronics/Camera/Digital/SLR/
So, how would I go about combining both of the above URL in one, once they are done with selecting the location and the category?
I might need to pass in the page number for pagination. (http://foo.com/page/2/)
I'd like to keep the URL clean and self explanatory.
I know how to do one type of URL at a time but not combining multiple types.
If I were to do a GET, then I would be doing: http://foo.com/?locid=23323&catid=335&page=2, but I like to take advantage of Django's clean URL and stay way from the ?& stuff.
Thanks,
VN44CA
I think that this would be to many information in the URL. I assume that any location has its unique ID, the same goes to category. Why not build a URL:
http://foo.com/United-States/Electronics/
http://foo.com/California/Digital/
http://foo.com/San-Francisco/SLR/
and so on...
2 arguments are enough in your case. Or you can change category name to be more meaningful.
http://foo.com/Electronics/Camera/Digital/ => http://foo.com/Digital-Cameras/
Depending on how you are using the location data, and how often a user will want to change the location, it may be best stored in the session instead of having it specified in the URL.
For example, I am unlikely to start off looking for SLR digital cameras in San Francisco and then go looking for basketballs in Baltimore.
Obviously this won't be sufficient if you want permalinks to any location-category combination, though.
After thinking about this for a while, I found that the best solution (for me) to this is to have a string just hold all the arguments that I need in a clean URL.
So, when users first come to http://foo.com/ they are presented with a locations to select. Cookies are empty at this point.
So, a user goes ahead and selects United-State, the URL will look like http://foo.com/12334_0_0_0/United-States/ and the location cookie is set to 1234 which is the id for location United States.
Now the user selects California and the URL changes to http://foo.com/1235_0_0_0/United-States-California/ and cookie is replace from United states to 1235 which is the id for the location California. At this point the user selects Category Electronics. so the URL changes to http://foo.com/1235_3333_0_0/Electronics/ and 3333 is saved in the Category Cookies.
If the users drops down to SLR Camera, then s/he'll see http://foo.com/1235_3344_0_0/SLR-Cameras/.
This way, the first portion of the URL keeps track of up to 4 arguments which can be passed around and the names (slugs) are merely for presentation and SEO.
I think this would work right? It would be cool to have the x_y_z_p portion of the URL encoded into some random text and decode back into args & numbers.
Let me know what you do think?

Resources