bolt / bolt-extension-rssaggregator

An RSS Aggregator extension for Bolt CMS.
http://bolt.cm
MIT License
2 stars 0 forks source link

Request in https? #1

Open mattiaslundback opened 9 years ago

mattiaslundback commented 9 years ago

Hi

I'm trying to use the RSS aggregator for loading atom-feeds from Google API custom search. Trying to make an "related links" application that really works. But if I'm not mistaken the calls are made by http and not https, even if the url has the https prefix. This poses a problem in this case, since Google only allows https.

I could be wrong, but otherwise this might be something that could be improved in this otherwise excellent extension.

Mattias

GwendolenLynch commented 9 years ago

Hi @mattiaslundback

Yes, this is really undesirable... I've had a quick look and can't spot the obvious. I'll have a further dig!

GwendolenLynch commented 9 years ago

@mattiaslundback do you have a URL I can test with that doesn't work for you?

mattiaslundback commented 9 years ago

It has an API key, so I should perhaps not use it here. But it has this format

https://www.googleapis.com/customsearch/v1?key=KEY&cx=CUSTOMSEARCHID&q=test&alt=atom

I might have jumped to an early conclusion, unless you know it uses http. I notice that it just returns an empty reply or a reply that cannot be parsed. Could also be that the items in the API are unconventional. The API works, however. I used it in a Javascript version also. However, that solution would soon reach the Google limit of 100 searches.

I could send you the search-string by mail if you want.

GwendolenLynch commented 9 years ago

It has an API key

Yeah, that is fine... I can set one up, don't compromise your account, I wasn't thinking properly and trying to solve things in a hurry :-)

I'll try to have a play tomorrow, I don't think this is a hard problem to solve... Maybe just fiddly.

mattiaslundback commented 9 years ago

Many thanks, you pointed me in the right direction. Now I can fix it. There was never anything wrong with the request.

Think this could be a useful extension when it is ready, there is really nothing out there that works very well when it comes to related links to blog-posts. But this method is very accurate and selective since it is based on Google Custom search.

I will probably have a version ready for late this evening, if everything works out right.

mattiaslundback commented 9 years ago

It took me some time, but now I have a finished extension. You can see it in action at my blog:

http://www.ekonomism.us/

mattiaslundback commented 9 years ago

I've also put it in a repository on GitHub. There are some issues with escaping characters in rssaggregator. I've done some quick and dirty adjustments in the code. I think there is some "double escaping" going on. Seen this in RSS feed, but then it was fixed. Don't know how, however.

GwendolenLynch commented 9 years ago

Great work @mattiaslundback !

I'll take a look at it when I free up some time... Also there is an active IRC channel on Freenode #boltcms if you're so inclined.

mattiaslundback commented 9 years ago

Thanks. But it was all because of RSS Aggregator I was able to pull it through. It takes some time when you are not a professional programmer, but I was lucky in the end to get away with five days of work. :-)

I will take a look at the IRC-channel. There are probably a lot of improvements do be made. And I will have to port it to Bolt 2.0 when it is ready and if it is accepted by Bob.

GwendolenLynch commented 9 years ago

The good news is that this gets much faster the more you do it :-)