GithubHelp home page GithubHelp logo

enderahmetyurt / podiscover Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 5.0 1.57 MB

Find your next podcast

Home Page: https://www.podiscover.me

Ruby 47.48% JavaScript 1.11% CSS 0.36% HTML 50.06% Shell 0.07% Procfile 0.06% Dockerfile 0.87%
discover podcasts social-media spotify

podiscover's People

Contributors

ccozkan avatar dependabot[bot] avatar enderahmetyurt avatar erimicel avatar furkanbay avatar kiliczsh avatar yavuzkomecoglu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

podiscover's Issues

Get podcast categories from itunes

url = "https://itunes.apple.com/search?term=uretim-bandi&media=podcast"

{
  "resultCount":1,
  "results":[
    {
      "wrapperType":"track",
      "kind":"podcast",
      "artistId":1266070581,
      "collectionId":1316366757,
      "trackId":1316366757,
      "artistName":"Üretim Bandı",
      "collectionName":"Üretim Bandı",
      "trackName":"Üretim Bandı",
      "collectionCensoredName":"Üretim Bandı",
      "trackCensoredName":"Üretim Bandı",
      "artistViewUrl":"https://podcasts.apple.com/us/artist/g%C3%BCmlet/1266070581?uo=4",
      "collectionViewUrl":"https://podcasts.apple.com/us/podcast/%C3%BCretim-band%C4%B1/id1316366757?uo=4",
      "feedUrl":"https://www.spreaker.com/show/2760879/episodes/feed",
      "trackViewUrl":"https://podcasts.apple.com/us/podcast/%C3%BCretim-band%C4%B1/id1316366757?uo=4",
      "artworkUrl30":"https://is3-ssl.mzstatic.com/image/thumb/Podcasts125/v4/4b/5a/d0/4b5ad056-55b8-f076-c8b8-3e451a3de6bc/mza_3670159721073446755.jpg/30x30bb.jpg",
      "artworkUrl60":"https://is3-ssl.mzstatic.com/image/thumb/Podcasts125/v4/4b/5a/d0/4b5ad056-55b8-f076-c8b8-3e451a3de6bc/mza_3670159721073446755.jpg/60x60bb.jpg",
      "artworkUrl100":"https://is3-ssl.mzstatic.com/image/thumb/Podcasts125/v4/4b/5a/d0/4b5ad056-55b8-f076-c8b8-3e451a3de6bc/mza_3670159721073446755.jpg/100x100bb.jpg",
      "collectionPrice":0.00,
      "trackPrice":0.00,
      "collectionHdPrice":0,
      "releaseDate":"2023-04-13T05:15:00Z",
      "collectionExplicitness":"notExplicit",
      "trackExplicitness":"cleaned",
      "trackCount":221,
      "trackTimeMillis":2496,
      "country":"USA",
      "currency":"USD",
      "primaryGenreName":"Technology",
      "contentAdvisoryRating":"Clean",
      "artworkUrl600":"https://is3-ssl.mzstatic.com/image/thumb/Podcasts125/v4/4b/5a/d0/4b5ad056-55b8-f076-c8b8-3e451a3de6bc/mza_3670159721073446755.jpg/600x600bb.jpg",
      "genreIds":[
        "1318",
        "26"
      ],
      "genres":[
        "Technology",
        "Podcasts"
      ]
    }
  ]
}

Fetch User Podcast exception

Whenever FetchUserPodcasts.perform_async(user.id, auth) method fails, even though the user is successfully saved into database we are throwing error. An begin rescue ensure can be useful here in my opinion.

Add search

We can search a podcast, an episode or a user with a keyword.

Update PD wordings

Some words are needed to update.

  • 38 people subscribe this podcast
  • Subscribes by
  • subscribes 32 podcasts
  • Some updates on feed

User slug space problem

Some people nicknames have spaces like the screenshot below. It doesn't look good. I think, we would do slugs like first-word-second-word if nicknames have spaces.

Screen Shot 2022-10-22 at 15 22 00

It looks better. Right?

Screen Shot 2022-10-22 at 15 26 32

Make category fetching automaticly

Currently I am fetching categories with running a script manuelly. It would better if we can make it automatic.

Fetch Category Flow

  • Open rails console on podiscover production running by heroku run rails c --app podiscover
  • First see which podcasts don't have any category running by Podcast.all.select{|podcast| podcast.categories.count == 0 }.map(&:name)
  • Fetch their uids running by Podcast.all.select{|podcast| podcast.categories.count == 0 }.map(&:uid)
  • Copy them to podcast_genre.rb file
  • Open Spotify on a web browser and, go to a podcast, and open browser console network tab. Check a http call i.e me look Headers, and find authorization, get Bearer token
  • Copy it to TOKEN variable in podcast_genre.rb file
  • Run podcast_genre.rb script
  • Copy script's output to an editor
  • Open seeds.rb file in podiscover codebase
  • Paste script's output to podcast variable in seeds.rb file (don't forget to add comma end of the lines)
  • Run create categories code block that is in seeds.rb file
  • Run connecting podcasts to categories code block that is in seeds.rb file
  • Find podcasts ids that don't have any category running by Podcast.all.select{|podcast| podcast.categories.empty?}.map(&:uid)
  • Assign podcast ids to a variable
  • Find Unknown category category = Category.find(45)
  • Run the code block about that in podiscover Slack assigning unknown category to the podcasts
  • Determine any podcasts don't have any category running Podcast.all.select{|podcast| podcast.categories.empty?}.map(&:uid)
# podcast_genre.rb
require 'rest-client'
require 'json'

podcasts = []

TOKEN = "YOUR_TOKEN"
result = []

podcasts.each do |podcast|
  url = "https://api-partner.spotify.com/pathfinder/v1/query?operationName=queryShowMetadataV2&variables=%7B%22uri%22%3A%22spotify%3Ashow%3A#{podcast}%22%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%22ce8932842e049a5ee1e9b0390506c6cd7310a6d6b421efb02b46497ace4026f1%22%7D%7D"

  response = RestClient.get url, {:Authorization => "Bearer #{TOKEN}"}
  if JSON.parse(response.body)["data"]["podcastUnionV2"]["topics"]
    items = JSON.parse(response.body)["data"]["podcastUnionV2"]["topics"]["items"]
    result << { uid: podcast, genres: items }

    puts podcast
    puts items
    puts "------------------------------------------"
  else
    puts "No topics for #{podcast}"
  end
end;nil
Podcast.all.select{|podcast| podcast.categories.empty?}.map(&:uid)
category = Category.find(45)
Podcast.where(uid: uids).each do |podcast|
  podcast.categories << category if podcast.categories.empty?
end

Podcast.all.each do |podcast|
  if podcast.categories.count > 1 && podcast.categories.include?(category)
    puts "Podcast #{podcast.uid}"
  end
end; nil


category = Category.where(name: "Unknown").first
Podcast.all.select do |podcast|
  if podcast.categories.empty?
    puts "Podcast #{podcast.name} has no categories"
    podcast.categories << category
  end
end

Podcast.all.select{|podcast| podcast.categories.count == 0 }.map(&:name)

Newsletter

Send newsletter to users when the podcasts that they follow have a new episode.

Add languages flag (emoji) to podcast

To Podcast card we can add the language of the podcast.

Some podcasts have more than two languages episodes. For now we don't need to think about it.

Country and Language Filters

Categories section could has filters like "country" and "language". So we can see which podcasts are the most popular in Germany or in Egypt.

Users can add tags to their profile

User can add some tags to their profiles.

I mean. Tags might be from podcasts' categories. In that way, I think we can understand which users can like to listen which podcasts.

Reducing Docker image size

Using ruby:3.2.2-alpine instead of ruby:3.2.2 would be applied to reduce the image size as current image size is 454.55 MB.

  • Update Dockerfile
  • Update compile.yml and docker.yml
  • Check if new Docker image size < 454.55 MB
  • Run docker compose to be sure the image is working

docker-compose is not working local development

Previously I had configured .env file locally and just running docker-compose up and db:create & db:migrate then I could access to the application. I have created a branch for working version of docker-compose I implemented: fix-docker.

@enderahmetyurt can you try to use docker-compose locally. Otherwise people won't be able to have a easy onboarding for contribution.

Add like/dislike to episodes

Add a like and a dislike button to a episode. We can show number of likes. We don't need to show number of dislikes.

Integrate 'friendly_id' to users

As a user I would like to have my profile path as /users/:username rather than /users/:id.

requirements

  • integrate friendly id to user model
  • make profile page path /users/:username

User bookmarks

An user can add podcast or podcast episodes to their bookmarks.

Migration Problem

Whenever I run migration episode_segments is lost. Is there a possibility that migration does not exists?

Screenshot 2023-06-17 at 21 34 34

Set CI

We need to set continuous integration.

User card

A user can share their profile in social media. I think, we need a user card. It can include user profile name, etc and their top podcast. These top podcast can voted by the user theirself.

I guess when we deploy this #26 this PR we can focus this.

I believe this would be a good feature for users. They can share their profile, and if we generate an embedded code, they can put it to their web sites.

Mock Data for development

I can't see much data to test some features or to do some development ideas, tests etc. Is there a possible way to increase the data amount?

Using images for builds

I think using this docker-compose.yml will be enough to run on production. This can be documented no need to add some files in my opinion:

version: '3'

services:
  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword
      POSTGRES_DB: mydatabase
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

  redis:
    image: redis
    restart: always

  podiscover:
    image: eaydev/podiscover:e41c7ab311fb7334d6249daf307206293d7c56a1
    environment:
      REDIS_URL: redis://redis:6379/1
      RAILS_ENV: production
      RACK_ENV: production
    depends_on:
      - redis

volumes:
  bundle:

  • image: eaydev/podiscover:latest can also be used for latest image.

Podcast#search show no podcast found message if any podcast not found by query

Run COVERAGE=true bundle exec rspec --require rails_helper
...................F................

Failures:

  1) Podcast#search show no podcast found message if any podcast not found by query
     Failure/Error: <%= link_to podcast_path(podcast) do %>

     ActionView::Template::Error:
       No route matches {:action=>"show", :controller=>"podcasts", :id=>nil}, missing required keys: [:id]
     # ./app/views/shared/_rightbar.html.erb:9:in `_app_views_shared__rightbar_html_erb___3879654349936865782_101740'
     # ./app/views/podcasts/search.html.erb:45:in `_app_views_podcasts_search_html_erb__156977749[12](https://github.com/enderahmetyurt/podiscover/actions/runs/5700453725/job/15450344274#step:9:13)0753341_102180'
     # ./spec/requests/podcasts_request_spec.rb:36:in `block (3 levels) in <main>'
     # ------------------
     # --- Caused by: ---
     # ActionController::UrlGenerationError:
     #   No route matches {:action=>"show", :controller=>"podcasts", :id=>nil}, missing required keys: [:id]
     #   ./app/views/shared/_rightbar.html.erb:9:in `_app_views_shared__rightbar_html_erb___3879654349936865782_10[17](https://github.com/enderahmetyurt/podiscover/actions/runs/5700453725/job/15450344274#step:9:18)40'

Finished in 1.71 seconds (files took 3 seconds to load)
36 examples, 1 failure

Failed examples:

rspec ./spec/requests/podcasts_request_spec.rb:35 # Podcast#search show no podcast found message if any podcast not found by query

Collect same activity types

We have many types of activities. In feed, a user might has many activities in same activity type we can collect them in a row like Github does

Screenshot 2022-11-19 at 14 27 24

I don't know how we can do, and show up it.

Maybe we can start to implement it like Github style

Screenshot 2022-11-19 at 14 29 39

Screenshot 2022-11-19 at 14 29 43

Same displayname slug problem

We have users that have same display names.

Screen Shot 2022-10-22 at 15 34 45

so we cannot update their slugs to same name because of slug uniqness validation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.