Thank you for all the API

In our days it is simpler to make an application by putting together some API . I wanted to make a list of all my 5 Minutes .NET playlist videos . First, I have tried to find an application(nothing). Then I have read  You Tube API from https://console.developers.google.com/apis/library . With 2 http requests( one for retrieving all videos from a playlist, the other to find video details) and a NuGet package to export to Excel/Word/PDF/HTML it was simple. You can find the whole project at https://github.com/ignatandrei/YouTube . A video demo at https://www.youtube.com/watch?v=wNHDsHtLBq4 . And the whole list at https://github.com/ignatandrei/ToolsAndUtilities/tree/gh-pages

Powerpoint macro to reveal

I think that everyone knows PowerPoint. However, reveal.js is a simple js+css + html to make presentation. I like it – and it is easy to put on any presentation.

Remembering my VB roots , I have created a simple PowerPoint macro to save presentation as reveal. It takes advantage that PowerPoint could save the slides as JPG.

Some sample code is here:

 

Sub ToReveal()
‘where to save the reveal
Dim rootFolder As String
rootFolder = "D:\"

Dim sld As slide, shp As Shape
Dim textSlide As String
Dim p As Presentation
Set p = ActivePresentation
Dim name As String
name = p.name
If (InStr(1, p.name, ".") > 1) Then
name = Mid(name, 1, InStr(1, p.name, ".") – 1)
End If
Dim NameFolder As String
NameFolder = rootFolder + name + "_reveal"

ActivePresentation.SaveCopyAs NameFolder, ppSaveAsJPG
Dim Sections As String, i As Integer, max As Integer
max = p.Slides.Count

For i = 1 To max
Sections = Sections + vbCrLf
Sections = Sections + "<section>"
Sections = Sections + "<img src=’Slide" & i & ".jpg’>"
Sections = Sections + "</section>"

Next i
Dim str As String
str = OriginalReveal()
str = Replace(str, "#PPTName#", p.name)
str = Replace(str, "#section#", Sections)

Dim fileName As String, textRow As String, fileNo As Integer
fileName = NameFolder + "\index.html"
fileNo = FreeFile ‘Get first free file number

Open fileName For Output As #fileNo
Print #fileNo, str
Close #fileNo

End Sub

The full source code is on https://github.com/ignatandrei/ppt2reveal/tree/master

Press ALT+F11 , paste code and enjoy!

YouTube playlist exporter

 

The point here is about how simple is in our days to make a simple script as a programmer.

I wanted to export my playlists ( 5 minutes .NET , Export Word Exce l PDF  , EF 6 , Traceability ) videos into a simple HTML file that I could put into my website.

I searched first on internet – however, I found just you tube google api .

So I read the documentation (e.g. https://developers.google.com/youtube/v3/docs/videos/list)  , grab a developer key from https://console.developers.google.com/ and made a simple project.

Used also a NuGet package for JSON( Newtonsoft.Json) and one for export in Excel /Word /HTML / PDF /ODS (ExporterWordExcelPDF).

Total time : 2 hours. You can find the project here https://github.com/ignatandrei/YouTube . It has only console application  – but it will have soon a GUI .

The point is that in our days it is easy to use third party application – and , for a programmer, easy as pie( eating, not making ; – ) )