I am making a website to help video games streamers (on twitch), but to do so I need to analyze there streams and videos. I can always ask the users to download their videos from twitch and upload them on my website but I need a more automatic way... So my question is: is there a way to acquire the video data and the live stream data? Maybe by asking the user to link his twitch account? Or by using a scraper on the twitch website?
Note: I need the stream and videos data itself (i am going to do some image processing on them)
You can do this multiple ways.
Way 1.
Use the twitch api V5
import requests
import json
r = requests.get("https://api.twitch.tv/kraken/channels/<channel ID>/videos
", headers={"Client-ID":"CLIENTID"})
j = json.loads(r.text)
j['url']
to gather all videos and download then execute a command via python or whatever language you choose. To execute either of two options. Youtube-DL which the command would be as follows
youtube-dl twitchVideoURL
or using twitch-dl
which you could execute a command like
twitch-dl download twitchVideoURL
Way 2
use purely twitch-dl
This way you would end up running
twitch-dl videos twitchChannelName
which would give you an output as follows (this just grabbed off his github readme)
Found 33 videos
221837124
SUPER MARIO ODYSSSEY - Stream #2 / 600,000,000
Bananasaurus_Rex playing Super Mario Odyssey
Published 2018-01-24 # 12:05:25 Length: 3h 40min
221418913
Dead Space and then SUPER MARIO ODYSSEY PogChamp
Bananasaurus_Rex playing Dead Space
Published 2018-01-23 # 02:40:58 Length: 6h 2min
From there you could grab the first line of each new video. Finally putting that id into
twitch-dl download VideoID
Hopefully this gives you some ideas as to how to do this. As you never specified a language I tried to for the most part be as generic as possible.
Related
there's a Chrome Extension called "Lead Extractor" that when you search i.e. "Barbers in New York" allows you to download a CSV file with a list of all the merchants with Address, opening hours, reviews count, phone number etc etc. ( for better understanding click HERE) Is there any way to do what this extension does using Python?
I tried to look around but I wasn't able to find much. Thank you! I am a novice and I automated the process with PYAutoguy, but the process is time consuming and sometimes it things get messed up and the cursors ends up roaming around aimlessly without downloading anything.
I am trying to collect some data for a pet study. I would be collecting some metadata on the video suggestions based on a search. I was wondering if it is possible to do the following using the Youtube API(python or R) :
Input a search keyword and get the results
Choose one of the videos randomly and see the list of video suggestions.
Choose one of the suggested videos randomly.
Repeat this "n" times.
Is there a way to emulate this entire process? I think web-scraping can be an option but I am not really sure, how I would go about it. So if there are nay pointers that would be amazing and get me started.
Also, Is it possible to have no history, as in an option to erase all the cookies for the previous attempt(Steps 1 through 4) and start afresh? (More like an option to have this in Incognito Mode)
TIA for your suggestions.
AFAIK Google tracks the computer you are using in such a way that you can't escape their filter bubble. Even through Tor, YouTube might prefer some content related to the exit node IP location (and so language) or any previous YouTube search done by you (through this exit node) or another user of the end node or any computer using the same IP as the exit node...
The YouTube Data API v3 has a possibility to retrieve suggestions thanks to part=suggestions with Videos: list by authenticating with OAuth (so results might not be neutral). You can get the initial videos thanks to Search: list thanks to q filter. Web-scraping is also doable to be less tracked, my open-source YouTube operational API is able to web-scrape search results for instance.
Note that a French person claims having achieved to have done such a neutral French YouTube suggestions graph.
I'm trying to figure out what the best way to print from App Maker. I have a guess management app and I need a way to print out guest passes from app maker. I have some ideas, but I'm not sure what would work or be the acceptable best practice. These will print out on a 4x6 thermal printer. Any working examples would be greatly appreciated. I've only managed to get option two below to work without css formatting.
1) Open the guest info in a page fragment and print it. This would need to print the page fragment as displayed, unsure if this is possible in app maker.
2) Create an html page by passing the guests information, open the page in a new tab and use windows print.
3) Use a mailmerge of sort on a document on google drive and print with cloud print. I'm worried that the lag time might make this slow. I'm also unsure if it's doable.
Thank You
It sounds like you want to manually print them.
You could have a 'Visitor Card' template saved as either a Google Document or Google Sheet. When the visitor signs in, duplicate that document, write your visitors information to the appropriate cells/positions, then save as a PDF in a Google Drive location.
All of the above can automated, so you'll simply have to have a tab open at the Drive location and then print the file once saved. The saving process shouldn't take any longer than 5-10 seconds, which I think is a reasonable timeframe.
Another option, which is more technical, is you directly send a request to your printer to print. Although, this would depend on your printer and technical capabilities.
I work for a nonprofit which help disabled military veterans. We have all our participants register with us using Salesforce as the repository of their registrations. We have dashboard components in Salesforce Lighting which totals up the number of active participants we have. I would like to display the component on our WordPress site but have never done anything like that before. I was hoping to find someone who has done something like that and offer some direction on how to go about doing it.
I tried looking up WordPress plugins which integrate with Salesforce. Most seem to be geared towards sending registrations back and forth but not displaying information. From a little bit of research, it seems like coding might need to be involved. Maybe doing a REST API with a Post option which will send the data through an HTTP URI? But to my understanding is that it would require WordPress to be an API. I am sure there are gaps in my logic.
I dont have an extensive amount of programing language experience but am willing to learn. I have taken a few Java and JavaScript classes in school.
I have not attempted this yet. I am just looking for feedback and direction.
Few options here, in no specific order...
Do Wordpress users have real Salesforce accounts or is their data simply stored in SF? Ask your Salesforce admin if there's a "customer community" configured (if your SF org is really old he might refer to it as customer portal). Communities offer nice way of exposing SF to poeple who don't need full SF user licenses. Think like collaborating with real SF users on "My Cases", viewing reports & dashboards... But for this you'd really need people logged in to SF so it won't work if you want just something anonymous. Some more info
Another option might be using Sites (Visualforce pages that expose SF data to guest users). Think like displaying a product catalog, FAQ, web-to-lead form or some other generic "contact us" page that's anonymous. So if you have SF developer (or admin with good copy-paste skills) you could use some Visualforce charts. They can be 100% coded (like this) or fed data from a report (like this) so it's simpler for admin to change the report filters or something without really writing code. Not sure if the simple route will work on a Site, there are some old answers that say "No", you might have to try it out. Worst case you'd need Apex code (or JavaScript) to query SF for results and display them. And display that SF Site page as <iframe> in Wordpress.
A slight twist on the Sites option - do you use Chatter (bit like Twitter inside SF)? There's way to take a snapshot of a report when a milestone has been met and post it to chatter ("congrats for hitting X participants"). And embed feeds on Visualforce pages too. Docs
What SF edition you're on (Group/Professional/Enterprise...)? If you have API access to Salesforce you could query the info yourself from Wordpress and display it using whatever charting library's easiest for you (Google Charts, Flot...). There are tons of examples how to connect to SF from PHP (or maybe you could cannibalize a WP plugin). Technically it's one POST message to log in to SF and one GET to run a query (something as simple as SELECT COUNT() FROM Contact WHERE isActive__c = true?)
That'd be more or less everything in terms of pulling data out of Salesforce. I mean if you have API access enabled you can slice & dice it how you want, extract data with raw PHP code or use some middleware but overall idea doesn't change. Write queries yourself or use "Analytics API" to access report results (so your administrator has power to change it without coding)...
So how about pushing? SF could notify you about current participants count. At scheduled intervals or even realtime. That'd be "just" raw data though, you'd have to write visualisation yourself.
Plenty of options here
workflow rules (code-free), sends XML message to specified URL so you'd need a WP page that can "capture" the result. Could be sent on creation of new record or update of existing. Won't give you totals, it'd be data related to that particular record so you'd have to build kind of +1 / -1 counter... Or if you use a report + analytic snapshot (helper object to store report results) and have workflow on that - that could be really close to what's needed.
scheduled apex job to run some queries and send the results to you. Again - you'd need a WP url that can be called from SF
if there's a CometD plugin for Wordpress you should look at Salesforce Streaming API, Platform Events or (newer and even simpler to configure) Change Data Capture. Basically you "subscribe" to a topic (a SF query) and whenever SF data changes and SF decides it'd change the results of the query - it'd push the results to you. It's almost realtime. Too much to write about them, perhaps best if you'd try to click through some trailheads - SF self-paced training courses:
https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_streaming
https://trailhead.salesforce.com/en/content/learn/modules/change-data-capture
https://trailhead.salesforce.com/en/content/learn/modules/platform_events_basics
I'm new here so firstly sorry for all my mistakes.
I'm trying to add one more radio station to my raspberryPi based online radio player (of course for private use only). It is an polish radio, radio Wawa. Here is the official site and stream: https://www.eskago.pl/radio/wawa But unfortunately on official site there are some adds before stream start (and I don't see the stream url :( ). I found an unofficial site with stream: https://pl.radioonline.fm/sluchac/Radio-WAWA Here there is no adds but still it's some complicated for me to extract stream which would be useful to play e.g. in omxplayer.
I found that the url for stream is http://waw.ic.smcdn.pl/t050-1.aac but the site is adding to this url a timestamp and a mistery hash. Full request looks like:
http://waw.ic.smcdn.pl/t050-1.aac?timestamp=1546208561&hash=25d2e0deebc354c9e9b5c37b74b64f21
Now is the question: is it possible to play this with command line only (the best option with omxplayer)? And how?
Thanks.