[GH-ISSUE #129] [FEATURE] Currency conversion #96

Closed
opened 2026-02-25 20:34:53 +03:00 by kerem · 15 comments
Owner

Originally created by @Aikatsui on GitHub (Oct 5, 2020).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/129

Originally assigned to: @vacom13 on GitHub.

  1. Time
    Whoogle display time in 24 format. search: pakistan time, google display it in AM/PM format

  2. Currency conversation
    This feature not available on whoogle. search: eur to usd
    (You can attach cool component for that)

  3. Weather
    This feature not available on whoogle. search: pakistan weather or certain city weather
    (You can ignore if difficult to implement)

  4. Calculator
    This feature not available for whoogle. search: calculator

(You may need to integrate other services if difficult to take from google)

So far i only expect solution for 1 and 2.

Originally created by @Aikatsui on GitHub (Oct 5, 2020). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/129 Originally assigned to: @vacom13 on GitHub. 1. Time Whoogle display time in 24 format. search: pakistan time, google display it in AM/PM format 2. Currency conversation This feature not available on whoogle. search: eur to usd (You can attach cool component for that) 3. Weather This feature not available on whoogle. search: pakistan weather or certain city weather (You can ignore if difficult to implement) 4. Calculator This feature not available for whoogle. search: calculator (You may need to integrate other services if difficult to take from google) So far i only expect solution for 1 and 2.
kerem 2026-02-25 20:34:53 +03:00
Author
Owner

@accountForIssues commented on GitHub (Jun 13, 2021):

I think 2-4 are not possible to implement as Google loads this via javascript in the browser whereas Whoogle scrapes and parses the results from a no-javascript version of Google search results.

@benbusby I thought it was possible to view (basic) results to such queries (1-3) using Whoogle. I remember it worked some versions ago (maybe I misremember). Currently on the latest version, none seem to work. Using the same query on Google no-js page (gbv=1), they show basic results for the query.

Example queries;

  • usd to gbp
  • weather nyc
  • time london
  • 15*88
  • dog in polish

Usually, the first div in the search results is the basic answer response to such queries. I know Google makes it difficult by randomizing the class names often but is it possible for Whoogle to detect/scrape these and show it ? Currently, it feels like they are being removed as all other results remain.

<!-- gh-comment-id:860185823 --> @accountForIssues commented on GitHub (Jun 13, 2021): I think 2-4 are not possible to implement as Google loads this via javascript in the browser whereas Whoogle scrapes and parses the results from a no-javascript version of Google search results. @benbusby I thought it was possible to view (basic) results to such queries (1-3) using Whoogle. I remember it worked some versions ago (maybe I misremember). Currently on the latest version, none seem to work. Using the same query on Google no-js page (`gbv=1`), they show basic results for the query. Example queries; - usd to gbp - weather nyc - time london - 15*88 - dog in polish Usually, the first `div` in the search results is the basic answer response to such queries. I know Google makes it difficult by randomizing the class names often but is it possible for Whoogle to detect/scrape these and show it ? Currently, it feels like they are being removed as all other results remain.
Author
Owner

@ghost commented on GitHub (Jun 18, 2021):

This may make delay to implement this feature but it's not a problem, if we can go to next level than to google search then it'll be better too while privacy friendly. so i like to add a comment (enhancement request) about 2 and 3. I guess there're many free data providing services sites and APIs. (If that sounds like forcing, there's no thing like you should implement, that's only suggestions to make this project better 😄)

Currency conversation
e.g. the search engine get data from morningstar and coinbase for cryptocurrency
https://developers.coinbase.com (Retrieve real-time or historical price information) that's only an example; not as suggestion to use it or particular api. i don't know about its usability and on limited environments etc or possible to scrape from sites.

i'm interest to see whoogle usable to view day/week/years currency statistics charts, contents from economic calendar and other details useful for particular field persons. it'll be amazing for other whoogle users.

Weather
I assume this feature hasn't worked when @Aikatsui opened this issue but now it seems work to show weather in specific country or city from weather.com

image
image

It'll be better if it also able to display past and future weather details UI and some other useful contents.

About "Calculator"
This doesn't need to fetch any remote data or connect to anywhere. I think you may able to add a built-in powerful calculator that has many facilities and work perfectly with web-apps to use with desktop and mobile web browsers.

Thank you for develop whoogle. 🥇 we like it alot 👍 app-0.5.0

<!-- gh-comment-id:864199200 --> @ghost commented on GitHub (Jun 18, 2021): This may make delay to implement this feature but it's not a problem, if we can go to next level than to google search then it'll be better too while privacy friendly. so i like to add a comment (enhancement request) about 2 and 3. I guess there're many free data providing services sites and APIs. (If that sounds like forcing, there's no thing like you should implement, that's only suggestions to make this project better :smile:) **Currency conversation** e.g. the search engine get data from morningstar and coinbase for cryptocurrency https://developers.coinbase.com (Retrieve real-time or historical price information) that's only an example; not as suggestion to use it or particular api. i don't know about its usability and on limited environments etc or possible to scrape from sites. i'm interest to see whoogle usable to view day/week/years currency statistics charts, contents from economic calendar and other details useful for particular field persons. it'll be amazing for other whoogle users. **Weather** I assume this feature hasn't worked when @Aikatsui opened this issue but now it seems work to show weather in specific country or city from weather.com ![image](https://user-images.githubusercontent.com/81799342/122598831-8da56d00-d097-11eb-8999-cbafb022e43c.png) ![image](https://user-images.githubusercontent.com/81799342/122599147-11f7f000-d098-11eb-92cc-29905cfd589d.png) It'll be better if it also able to display past and future weather details UI and some other useful contents. About "**Calculator**" This doesn't need to fetch any remote data or connect to anywhere. I think you may able to add a built-in powerful calculator that has many facilities and work perfectly with web-apps to use with desktop and mobile web browsers. Thank you for develop whoogle. :1st_place_medal: we like it alot :+1: app-0.5.0
Author
Owner

@benbusby commented on GitHub (Sep 15, 2021):

Closing, since the issue is quite old at this point, and each of the OP's queries for basic currency conversion, weather, etc seem to all be working as expected.

<!-- gh-comment-id:920423874 --> @benbusby commented on GitHub (Sep 15, 2021): Closing, since the issue is quite old at this point, and each of the OP's queries for basic currency conversion, weather, etc seem to all be working as expected.
Author
Owner

@itsnotsaved commented on GitHub (Nov 2, 2021):

Closing, since the issue is quite old at this point, and each of the OP's queries for basic currency conversion, weather, etc seem to all be working as expected.

@benbusby Request to reopen, currency conversation doesn't work

image

image

<!-- gh-comment-id:957262505 --> @itsnotsaved commented on GitHub (Nov 2, 2021): > Closing, since the issue is quite old at this point, and each of the OP's queries for basic currency conversion, weather, etc seem to all be working as expected. @benbusby Request to reopen, currency conversation doesn't work ![image](https://user-images.githubusercontent.com/73447325/139820909-d6354480-8e09-46a0-9c8b-eb58eb67c4fd.png) ![image](https://user-images.githubusercontent.com/73447325/139820963-785478a3-9d1f-42ea-890b-dc9277bb0164.png)
Author
Owner

@itsnotsaved commented on GitHub (Nov 2, 2021):

@accountForIssues has said,

I think 2-4 are not possible to implement as Google loads this via javascript in the browser whereas Whoogle scrapes and parses the results from a no-javascript version of Google search results.

if not possible, may be you can integrate any good solution as @urynon said,

Currency conversation
e.g. the search engine get data from morningstar and coinbase for cryptocurrency
https://developers.coinbase.com (Retrieve real-time or historical price information) that's only an example; not as suggestion to use it or particular api. i don't know about its usability and on limited environments etc or possible to scrape from sites.
i'm interest to see whoogle usable to view day/week/years currency statistics charts, contents from economic calendar and other details useful for particular field persons. it'll be amazing for other whoogle users.

I saw these resources,
https://exchangerate.host/
https://github.com/exchangeratesapi/exchangeratesapi and it is deployable to heroku etc as whoogle.
(as i see its cloud service 250 requests/m free https://exchangeratesapi.io/) and not sure if that a good idea to integrate "exchangeratesapi" but no public instances as libreddit, lingva etc except exchangeratesapi.io

<!-- gh-comment-id:957272084 --> @itsnotsaved commented on GitHub (Nov 2, 2021): @accountForIssues has said, > I think 2-4 are not possible to implement as Google loads this via javascript in the browser whereas Whoogle scrapes and parses the results from a no-javascript version of Google search results. if not possible, may be you can integrate any good solution as @urynon said, > Currency conversation e.g. the search engine get data from morningstar and coinbase for cryptocurrency https://developers.coinbase.com (Retrieve real-time or historical price information) that's only an example; not as suggestion to use it or particular api. i don't know about its usability and on limited environments etc or possible to scrape from sites. i'm interest to see whoogle usable to view day/week/years currency statistics charts, contents from economic calendar and other details useful for particular field persons. it'll be amazing for other whoogle users. I saw these resources, https://exchangerate.host/ https://github.com/exchangeratesapi/exchangeratesapi and it is deployable to heroku etc as whoogle. (as i see its cloud service 250 requests/m free https://exchangeratesapi.io/) and not sure if that a good idea to integrate "exchangeratesapi" but no public instances as libreddit, lingva etc except exchangeratesapi.io
Author
Owner

@vacom13 commented on GitHub (Nov 7, 2021):

@benbusby I would like to give a more fully featured currency conversion a try. Basically, as we discussed in the mention above, I would use the regex to identify whether search query includes such a request for conversion. If its true, I could basically just get the first card from response and use the numbers
example
in it and create my own conversion factor which I could then use for the input boxes shown below

example 2
then, I could code up some basic js for the same to allow for such conversions within the input box. As for knowing whether the user asked for a conversion, I was thinking of creating a json file with country currency codes in it so that the regex can use those. Does this make any sense?

<!-- gh-comment-id:962640129 --> @vacom13 commented on GitHub (Nov 7, 2021): @benbusby I would like to give a more fully featured currency conversion a try. Basically, as we discussed in the mention above, I would use the `regex` to identify whether `search query` includes such a request for conversion. If its true, I could basically just get the `first card` from `response` and use the numbers ![example](https://user-images.githubusercontent.com/69755265/140652548-6aa3d5e8-db31-44e5-bcb2-067bd04e469c.jpg) in it and create my own conversion factor which I could then use for the input boxes shown below ![example 2](https://user-images.githubusercontent.com/69755265/140652503-2dba2e9b-f8b0-4694-a960-5783ebcfd438.jpg) then, I could code up some basic js for the same to allow for such conversions within the input box. As for knowing whether the user asked for a conversion, I was thinking of creating a json file with country currency codes in it so that the regex can use those. Does this make any sense?
Author
Owner

@benbusby commented on GitHub (Nov 7, 2021):

@vacom13 yeah, that all sounds correct I think. As long as the JS you write is all self-contained (i.e. doesn't rely on external libraries) that should work great. I'm guessing a simple way to do that would be to use the ratio found in the original query -- for example 1:74.19 -- and use that to calculate new results for all subsequent values the user enters into the input box. If you want to rely on an external service though, you'd need to offload the calculation to the server instead, and just use JS to query for results.

<!-- gh-comment-id:962653617 --> @benbusby commented on GitHub (Nov 7, 2021): @vacom13 yeah, that all sounds correct I think. As long as the JS you write is all self-contained (i.e. doesn't rely on external libraries) that should work great. I'm guessing a simple way to do that would be to use the ratio found in the original query -- for example 1:74.19 -- and use that to calculate new results for all subsequent values the user enters into the input box. If you want to rely on an external service though, you'd need to offload the calculation to the server instead, and just use JS to query for results.
Author
Owner

@vacom13 commented on GitHub (Nov 7, 2021):

@benbusby I was thinking of simply using the ratio to avoid using external services. Is that cool? And yes the js wont rely on external libraries.

<!-- gh-comment-id:962654203 --> @vacom13 commented on GitHub (Nov 7, 2021): @benbusby I was thinking of simply using the ratio to avoid using external services. Is that cool? And yes the js wont rely on external libraries.
Author
Owner

@benbusby commented on GitHub (Nov 7, 2021):

@vacom13 yep, that sounds great

<!-- gh-comment-id:962658745 --> @benbusby commented on GitHub (Nov 7, 2021): @vacom13 yep, that sounds great
Author
Owner

@vacom13 commented on GitHub (Nov 11, 2021):

@benbusby just an update. I was thinking of making the regex when it hit me that a better way might be to just check for the disclaimer link in the first card of the search results and matching the href to https://g.co/gfd if it exists as surely, all the conversion queries which display this card would have it. Thereby accounting for all possible combinations effectively I think 😅.

Disclaimer

hrefy

<!-- gh-comment-id:966340404 --> @vacom13 commented on GitHub (Nov 11, 2021): @benbusby just an update. I was thinking of making the regex when it hit me that a better way might be to just check for the disclaimer link in the first card of the search results and matching the `href` to `https://g.co/gfd` if it exists as surely, all the conversion queries which display this card would have it. Thereby accounting for all possible combinations effectively I think 😅. ![Disclaimer](https://user-images.githubusercontent.com/69755265/141313287-9f17d3ee-fa32-4ad1-ab37-48528b754f0a.jpg) ![hrefy](https://user-images.githubusercontent.com/69755265/141313590-9611a9d1-53b9-41a9-9302-b1a489cc678a.jpg)
Author
Owner

@vacom13 commented on GitHub (Nov 13, 2021):

@benbusby I keep getting this error please help.

Error-1.jpg

The second one is what concerns me. It doesnt allow me to run the js function for some reason.

The code I wrote still needs to be improved 😅 but here it is.

Code.jpg

Js.jpg

<!-- gh-comment-id:968109519 --> @vacom13 commented on GitHub (Nov 13, 2021): @benbusby I keep getting this error please help. ![Error-1.jpg](https://user-images.githubusercontent.com/69755265/141654307-33159d2e-2cea-442f-8e52-5b146d8543fc.jpg) The `second one` is what concerns me. It doesnt allow me to run the js function for some reason. The code I wrote still needs to be improved 😅 but here it is. ![Code.jpg](https://user-images.githubusercontent.com/69755265/141654253-f1b92f5a-518d-43c1-8ff6-26c9f05a06d6.jpg) ![Js.jpg](https://user-images.githubusercontent.com/69755265/141654261-71a0b7ea-88a0-417b-9820-ceece4039a0e.jpg)
Author
Owner

@benbusby commented on GitHub (Nov 13, 2021):

@vacom13 you might want to disable the CSP while you're developing this. There's another issue in the backlog for removing it entirely, which I agree with, just haven't had a sec to do it yet. The line you'd want to remove is resp.headers['Content-Security-Policy'] = app.config['CSP'] in app/routes.py. It should stop giving you that error afterwards. I'll go through and more thoroughly remove it sometime this weekend and then you can merge that change into your branch.

<!-- gh-comment-id:968131819 --> @benbusby commented on GitHub (Nov 13, 2021): @vacom13 you might want to disable the CSP while you're developing this. There's another issue in the backlog for removing it entirely, which I agree with, just haven't had a sec to do it yet. The line you'd want to remove is ` resp.headers['Content-Security-Policy'] = app.config['CSP']` in `app/routes.py`. It should stop giving you that error afterwards. I'll go through and more thoroughly remove it sometime this weekend and then you can merge that change into your branch.
Author
Owner

@vacom13 commented on GitHub (Nov 15, 2021):

@benbusby okay great!

<!-- gh-comment-id:968867387 --> @vacom13 commented on GitHub (Nov 15, 2021): @benbusby okay great!
Author
Owner

@vacom13 commented on GitHub (Nov 17, 2021):

@benbusby I have the feature down. Maybe I could just create a pr and you can check?

<!-- gh-comment-id:971198881 --> @vacom13 commented on GitHub (Nov 17, 2021): @benbusby I have the feature down. Maybe I could just create a pr and you can check?
Author
Owner

@benbusby commented on GitHub (Nov 18, 2021):

@vacom13 for sure! Open a PR whenever you're ready

<!-- gh-comment-id:972461348 --> @benbusby commented on GitHub (Nov 18, 2021): @vacom13 for sure! Open a PR whenever you're ready
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#96
No description provided.